mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinay K Nallamothu <vinay.nallamothu@gsecone.com>
To: Marc-Christian Petersen <m.c.p@wolk-project.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH][2.2.27-rc2] memset usage fix
Date: Thu, 31 Mar 2005 17:13:07 +0530	[thread overview]
Message-ID: <1112269387.14917.25.camel@vinay.gsecone.com> (raw)

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.
_________________________________________________________________________



                 reply	other threads:[~2005-03-31 11:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1112269387.14917.25.camel@vinay.gsecone.com \
    --to=vinay.nallamothu@gsecone.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.c.p@wolk-project.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®