From: Joe Handzik Date: Wed, 26 Mar 2014 22:48:11 +0000 (-0500) Subject: hpsa: Checking for a NULL return from a kzalloc call X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3b51a7a3910fd5d4165600a64000a9ecf65835f7;p=deliverable%2Flinux.git hpsa: Checking for a NULL return from a kzalloc call Checking for a NULL return from a kzalloc call in hpsa_get_pdisk_of_ioaccel2. Signed-off-by: Scott Teel Signed-off-by: Joe Handzik Signed-off-by: Christoph Hellwig --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 9a6e4a2cd072..68254817c3be 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2836,6 +2836,8 @@ static int hpsa_get_pdisk_of_ioaccel2(struct ctlr_info *h, /* Get the list of physical devices */ physicals = kzalloc(reportsize, GFP_KERNEL); + if (physicals == NULL) + return 0; if (hpsa_scsi_do_report_phys_luns(h, (struct ReportLUNdata *) physicals, reportsize, extended)) { dev_err(&h->pdev->dev,