提交 713b6864 编写于 作者: D Dan Carpenter 提交者: Jens Axboe

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
上级 099c5c31
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册