From: Robert Elliott Date: Fri, 23 Jan 2015 22:42:42 +0000 (-0600) Subject: hpsa: report allocation failures while allocating SG chain blocks X-Git-Tag: v4.0-rc1~126^2~37 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3d4e6af8afe538e2bc5f0c52eb4dec6b50ede050;p=karo-tx-linux.git hpsa: report allocation failures while allocating SG chain blocks Reviewed-by: Scott Teel Signed-off-by: Robert Elliott Signed-off-by: Don Brace Signed-off-by: Christoph Hellwig --- 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) h->cmd_sg_list = kzalloc(sizeof(*h->cmd_sg_list) * h->nr_cmds, GFP_KERNEL); - if (!h->cmd_sg_list) + if (!h->cmd_sg_list) { + dev_err(&h->pdev->dev, "Failed to allocate SG list\n"); return -ENOMEM; + } for (i = 0; i < h->nr_cmds; i++) { h->cmd_sg_list[i] = kmalloc(sizeof(*h->cmd_sg_list[i]) * h->chainsize, GFP_KERNEL); - if (!h->cmd_sg_list[i]) + if (!h->cmd_sg_list[i]) { + dev_err(&h->pdev->dev, "Failed to allocate cmd SG\n"); goto clean; + } } return 0;