FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 02-11-2011, 09:17 PM
"Moger, Babu"
 
Default fix kzalloc in scsi device handler

From: Hillf Danton <dhillf@gmail.com>

Fixing the type for the kzalloc. Original path is here. http://marc.info/?l=linux-scsi&m=128991446117137&w=2

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Babu Moger <babu.moger@lsi.com>

---
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
",
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
",
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
",
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
",



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 05:08 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org