[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130308120215.GB18712@longonot.mountain>
Date: Fri, 8 Mar 2013 15:02:15 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "James E.J. Bottomley" <JBottomley@...allels.com>
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] [SCSI] scsi_transport_sas: check for allocation failure
Static checkers complain that this allocation isn't checked. We
should return zero if the allocation fails.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 1b68142..a022997 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -379,9 +379,12 @@ sas_tlr_supported(struct scsi_device *sdev)
{
const int vpd_len = 32;
struct sas_end_device *rdev = sas_sdev_to_rdev(sdev);
- char *buffer = kzalloc(vpd_len, GFP_KERNEL);
+ char *buffer;
int ret = 0;
+ buffer = kzalloc(vpd_len, GFP_KERNEL);
+ if (!buffer)
+ goto out;
if (scsi_get_vpd_page(sdev, 0x90, buffer, vpd_len))
goto out;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists