From 3b51a7a3910fd5d4165600a64000a9ecf65835f7 Mon Sep 17 00:00:00 2001 From: Joe Handzik Date: Wed, 26 Mar 2014 17:48:11 -0500 Subject: 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 --- drivers/scsi/hpsa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/scsi/hpsa.c') 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, -- cgit v1.2.3-59-g8ed1b