aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRobert Elliott <elliott@hp.com>2015-01-23 17:42:42 -0500
committerJames Bottomley <JBottomley@Parallels.com>2015-02-02 12:57:39 -0500
commit3d4e6af8afe538e2bc5f0c52eb4dec6b50ede050 (patch)
treef48787d8a691f250989b7c3d7bad70d074c91f52 /drivers/scsi
parent1eaec8f33e14afae5820a25059a59d9119ca308f (diff)
hpsa: report allocation failures while allocating SG chain blocks
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/hpsa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 64d17d1a848b..dc328ce146bb 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1480,13 +1480,17 @@ static int hpsa_allocate_sg_chain_blocks(struct ctlr_info *h)
1480 1480
1481 h->cmd_sg_list = kzalloc(sizeof(*h->cmd_sg_list) * h->nr_cmds, 1481 h->cmd_sg_list = kzalloc(sizeof(*h->cmd_sg_list) * h->nr_cmds,
1482 GFP_KERNEL); 1482 GFP_KERNEL);
1483 if (!h->cmd_sg_list) 1483 if (!h->cmd_sg_list) {
1484 dev_err(&h->pdev->dev, "Failed to allocate SG list\n");
1484 return -ENOMEM; 1485 return -ENOMEM;
1486 }
1485 for (i = 0; i < h->nr_cmds; i++) { 1487 for (i = 0; i < h->nr_cmds; i++) {
1486 h->cmd_sg_list[i] = kmalloc(sizeof(*h->cmd_sg_list[i]) * 1488 h->cmd_sg_list[i] = kmalloc(sizeof(*h->cmd_sg_list[i]) *
1487 h->chainsize, GFP_KERNEL); 1489 h->chainsize, GFP_KERNEL);
1488 if (!h->cmd_sg_list[i]) 1490 if (!h->cmd_sg_list[i]) {
1491 dev_err(&h->pdev->dev, "Failed to allocate cmd SG\n");
1489 goto clean; 1492 goto clean;
1493 }
1490 } 1494 }
1491 return 0; 1495 return 0;
1492 1496