aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss_scsi.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2011-03-11 14:07:38 -0500
committerJens Axboe <jaxboe@fusionio.com>2011-03-11 14:07:38 -0500
commit978eb516a4e1a1b47163518d6f5d5e81ab27a583 (patch)
treef61be533e3c97dd2c9e50a0fb54f3091eebe3ce0 /drivers/block/cciss_scsi.c
parent957c2ec558caff09a3bdf333871fc617830f063d (diff)
cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation
This bit got lost somewhere along the way. Without this, panic. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Cc: stable@kernel.org Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss_scsi.c')
-rw-r--r--drivers/block/cciss_scsi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 727d0225b7d0..3bfbde8b4013 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -226,6 +226,13 @@ scsi_cmd_stack_setup(ctlr_info_t *h, struct cciss_scsi_adapter_data_t *sa)
226 return -ENOMEM; 226 return -ENOMEM;
227 } 227 }
228 228
229 stk->elem = kmalloc(sizeof(stk->elem[0]) * stk->nelems, GFP_KERNEL);
230 if (!stk->elem) {
231 pci_free_consistent(h->pdev, size, stk->pool,
232 stk->cmd_pool_handle);
233 return -1;
234 }
235
229 for (i=0; i<CMD_STACK_SIZE; i++) { 236 for (i=0; i<CMD_STACK_SIZE; i++) {
230 stk->elem[i] = &stk->pool[i]; 237 stk->elem[i] = &stk->pool[i];
231 stk->elem[i]->busaddr = (__u32) (stk->cmd_pool_handle + 238 stk->elem[i]->busaddr = (__u32) (stk->cmd_pool_handle +
@@ -255,6 +262,8 @@ scsi_cmd_stack_free(ctlr_info_t *h)
255 pci_free_consistent(h->pdev, size, stk->pool, stk->cmd_pool_handle); 262 pci_free_consistent(h->pdev, size, stk->pool, stk->cmd_pool_handle);
256 stk->pool = NULL; 263 stk->pool = NULL;
257 cciss_free_sg_chain_blocks(sa->cmd_sg_list, CMD_STACK_SIZE); 264 cciss_free_sg_chain_blocks(sa->cmd_sg_list, CMD_STACK_SIZE);
265 kfree(stk->elem);
266 stk->elem = NULL;
258} 267}
259 268
260#if 0 269#if 0