diff mbox

[v2,SCSI] fix kzalloc in scsi device handler

Message ID E463DF2B2E584B4A82673F53D62C2EF4FF60C1F7@cosmail01.lsi.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

babu moger Feb. 11, 2011, 10:17 p.m. UTC
None
diff mbox

Patch

diff -uprN -X linux-2.6.38-rc4/Documentation/dontdiff linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_alua.c linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_alua.c
--- linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_alua.c	2011-02-07 18:03:55.000000000 -0600
+++ linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_alua.c	2011-02-11 15:29:31.000000000 -0600
@@ -759,7 +759,7 @@  static int alua_bus_attach(struct scsi_d
 	unsigned long flags;
 	int err = SCSI_DH_OK;
 
-	scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *)
+	scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
 			       + sizeof(*h) , GFP_KERNEL);
 	if (!scsi_dh_data) {
 		sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
diff -uprN -X linux-2.6.38-rc4/Documentation/dontdiff linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_emc.c linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_emc.c
--- linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_emc.c	2011-02-07 18:03:55.000000000 -0600
+++ linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_emc.c	2011-02-11 15:29:50.000000000 -0600
@@ -650,7 +650,7 @@  static int clariion_bus_attach(struct sc
 	unsigned long flags;
 	int err;
 
-	scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *)
+	scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
 			       + sizeof(*h) , GFP_KERNEL);
 	if (!scsi_dh_data) {
 		sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
diff -uprN -X linux-2.6.38-rc4/Documentation/dontdiff linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_hp_sw.c linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_hp_sw.c
--- linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_hp_sw.c	2011-02-07 18:03:55.000000000 -0600
+++ linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_hp_sw.c	2011-02-11 15:30:45.000000000 -0600
@@ -338,8 +338,8 @@  static int hp_sw_bus_attach(struct scsi_
 	unsigned long flags;
 	int ret;
 
-	scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *)
-			       + sizeof(struct hp_sw_dh_data) , GFP_KERNEL);
+	scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
+			       + sizeof(*h) , GFP_KERNEL);
 	if (!scsi_dh_data) {
 		sdev_printk(KERN_ERR, sdev, "%s: Attach Failed\n",
 			    HP_SW_NAME);
diff -uprN -X linux-2.6.38-rc4/Documentation/dontdiff linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_rdac.c linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_rdac.c
--- linux-2.6.38-rc4/drivers/scsi/device_handler/scsi_dh_rdac.c	2011-02-07 18:03:55.000000000 -0600
+++ linux-2.6.38-rc4-patched//drivers/scsi/device_handler/scsi_dh_rdac.c	2011-02-11 15:29:18.000000000 -0600
@@ -800,7 +800,7 @@  static int rdac_bus_attach(struct scsi_d
 	int err;
 	char array_name[ARRAY_LABEL_LEN];
 
-	scsi_dh_data = kzalloc(sizeof(struct scsi_device_handler *)
+	scsi_dh_data = kzalloc(sizeof(*scsi_dh_data)
 			       + sizeof(*h) , GFP_KERNEL);
 	if (!scsi_dh_data) {
 		sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",