[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200707312034.15089.m.kozlowski@tuxland.pl>
Date: Tue, 31 Jul 2007 20:34:14 +0200
From: Mariusz Kozlowski <m.kozlowski@...land.pl>
To: linux-kernel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-scsi@...r.kernel.org, megaraidlinux@....com
Subject: [PATCH 47] drivers/scsi/megaraid.c: kmalloc + memset conversion to kzalloc
This patch does kmalloc + memset conversion to kzalloc and adds missing check for
kzaloc return value.
Signed-off-by: Mariusz Kozlowski <m.kozlowski@...land.pl>
drivers/scsi/megaraid.c | 116109 -> 116094 (-15 bytes)
drivers/scsi/megaraid.o | 257872 -> 257772 (-100 bytes)
drivers/scsi/megaraid.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- linux-2.6.23-rc1-mm1-a/drivers/scsi/megaraid.c 2007-07-26 13:07:42.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/drivers/scsi/megaraid.c 2007-07-31 11:11:58.000000000 +0200
@@ -4408,8 +4408,10 @@ mega_internal_command(adapter_t *adapter
scmd = &adapter->int_scmd;
memset(scmd, 0, sizeof(Scsi_Cmnd));
- sdev = kmalloc(sizeof(struct scsi_device), GFP_KERNEL);
- memset(sdev, 0, sizeof(struct scsi_device));
+ sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
+ if (!sdev)
+ return -ENOMEM;
+
scmd->device = sdev;
scmd->device->host = adapter->host;
-
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