mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][2.2.27-rc2] memset usage fix
@ 2005-03-31 11:43 Vinay K Nallamothu
  0 siblings, 0 replies; only message in thread
From: Vinay K Nallamothu @ 2005-03-31 11:43 UTC (permalink / raw)
  To: Marc-Christian Petersen; +Cc: linux-kernel

Hi Marc,

Using Dave Jones memset script to detect swapped arguments, I found two
such instances. Patch attached.

Thanks
Vinay

 nubus/nubus.c |    2 +-
 usb/dabusb.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

=========================================================================
diff -urN linux-2.2.26/drivers/usb/dabusb.c linux-2.2.26-m/drivers/usb/dabusb.c
--- linux-2.2.26/drivers/usb/dabusb.c	2001-11-02 22:09:08.000000000 +0530
+++ linux-2.2.26-m/drivers/usb/dabusb.c	2005-03-31 17:03:23.335520936 +0530
@@ -224,7 +224,7 @@
 			err("kmalloc(sizeof(buff_t))==NULL");
 			goto err;
 		}
-		memset (b, sizeof (buff_t), 0);
+		memset (b, 0, sizeof (buff_t));
 		b->s = s;
 		b->purb = usb_alloc_urb(packets);
 		if (!b->purb) {
diff -urN linux-2.2.26/drivers/nubus/nubus.c linux-2.2.26-m/drivers/nubus/nubus.c
--- linux-2.2.26/drivers/nubus/nubus.c	2001-03-25 22:01:42.000000000 +0530
+++ linux-2.2.26-m/drivers/nubus/nubus.c	2005-03-31 17:02:40.908970752 +0530
@@ -563,7 +563,7 @@
 		/* Now clobber the whole thing */
 		if (size > sizeof(mode) - 1)
 			size = sizeof(mode) - 1;
-		memset(&mode, sizeof(mode), 0);
+		memset(&mode, 0, sizeof(mode));
 		nubus_get_rsrc_mem(&mode, &ent, size);
 		printk (KERN_INFO "      %02X: (%02X) %s\n", ent.type,
 			mode.id, mode.name);

=========================================================================
-- 
Views expressed in this mail are those of the individual sender and 
do not bind Gsec1 Limited. or its subsidiary, unless the sender has done
so expressly with due authority of Gsec1.
_________________________________________________________________________



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-31 11:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-31 11:43 [PATCH][2.2.27-rc2] memset usage fix Vinay K Nallamothu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®