projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
099c5c3
)
cciss: call BUG() earlier
author
Dan Carpenter
<error27@gmail.com>
Tue, 1 Jun 2010 10:17:48 +0000
(12:17 +0200)
committer
Jens Axboe
<jaxboe@fusionio.com>
Tue, 1 Jun 2010 10:17:48 +0000
(12:17 +0200)
I moved the range check after the increment. The current code would
write past the end of the array once before calling BUG().
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
drivers/block/cciss_scsi.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/block/cciss_scsi.c
b/drivers/block/cciss_scsi.c
index e1d0e2cfec72aaae4d332e693005d5d30833e8ab..3381505c8a6c309c7838cb7d0a4daff7e3e162e7 100644
(file)
--- a/
drivers/block/cciss_scsi.c
+++ b/
drivers/block/cciss_scsi.c
@@
-188,11
+188,11
@@
scsi_cmd_free(ctlr_info_t *h, CommandList_struct *cmd)
sa = h->scsi_ctlr;
stk = &sa->cmd_stack;
+ stk->top++;
if (stk->top >= CMD_STACK_SIZE) {
printk("cciss: scsi_cmd_free called too many times.\n");
BUG();
}
- stk->top++;
stk->elem[stk->top] = (struct cciss_scsi_cmd_stack_elem_t *) cmd;
}