summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2014-07-28 14:55:27 +0200
committerChristoph Hellwig <hch@lst.de>2014-07-30 07:49:37 -0400
commita5c277ec5a331171c6508924ce7767e363bf3a05 (patch)
treece8312cc20a327d56bb086c7de957b9c284903e4 /drivers/scsi
parent4d0a21f1fd31adb3ec66db4c1af3856ae0b8549f (diff)
downloadlinux-a5c277ec5a331171c6508924ce7767e363bf3a05.tar.gz
linux-a5c277ec5a331171c6508924ce7767e363bf3a05.tar.bz2
linux-a5c277ec5a331171c6508924ce7767e363bf3a05.zip
qla4xxx: check the return value of dma_alloc_coherent()
the qla4xxx_alloc_fw_dump() calls dma_alloc_coherent() but does not check its return value. Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Acked-By: Nilesh Javali <nilesh.javali@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla4xxx/ql4_init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 6f12f859b11d..4180d6d9fe78 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -334,6 +334,12 @@ void qla4xxx_alloc_fw_dump(struct scsi_qla_host *ha)
/* Allocate memory for saving the template */
md_tmp = dma_alloc_coherent(&ha->pdev->dev, ha->fw_dump_tmplt_size,
&md_tmp_dma, GFP_KERNEL);
+ if (!md_tmp) {
+ ql4_printk(KERN_INFO, ha,
+ "scsi%ld: Failed to allocate DMA memory\n",
+ ha->host_no);
+ return;
+ }
/* Request template */
status = qla4xxx_get_minidump_template(ha, md_tmp_dma);