mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
cciss: call BUG() earlier
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
099c5c310e
commit
713b686494
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue