public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Adrian Bunk <bunk@stusta.de>
Cc: o.bock@fh-wolfenbuettel.de,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: drivers/usb/misc/cypress_cy7c63.c: NULL dereference
Date: Mon, 14 Aug 2006 17:57:49 -0700	[thread overview]
Message-ID: <20060815005749.GA24238@suse.de> (raw)
In-Reply-To: <20060815000442.GB3543@stusta.de>

On Tue, Aug 15, 2006 at 02:04:42AM +0200, Adrian Bunk wrote:
> The Coverity Checker spotted the following obvious NULL dereference:
> 
> <--  snip  -->
> 
> ...
> static int cypress_probe(struct usb_interface *interface,
>                          const struct usb_device_id *id)
> {
> ...
>         if (dev == NULL) {
>                 dev_err(&dev->udev->dev, "Out of memory!\n");
>                 goto error;
>         }
> ...
> }
> ...
> 
> <--  snip  -->

Thanks for letting me know, the patch below should fix this.

greg k-h

------------

From: Greg Kroah-Hartman <gregkh@suse.de>
Subject: USB: fix bug in cypress_cy7c63.c driver

This was pointed out by Adrian Bunk <bunk@stusta.de>, as found by the
Coverity Checker.


Cc: Adrian Bunk <bunk@stusta.de>
Cc: Oliver Bock <o.bock@fh-wolfenbuettel.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/misc/cypress_cy7c63.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- gregkh-2.6.orig/drivers/usb/misc/cypress_cy7c63.c
+++ gregkh-2.6/drivers/usb/misc/cypress_cy7c63.c
@@ -208,7 +208,7 @@ static int cypress_probe(struct usb_inte
 	/* allocate memory for our device state and initialize it */
 	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (dev == NULL) {
-		dev_err(&dev->udev->dev, "Out of memory!\n");
+		dev_err(&interface->dev, "Out of memory!\n");
 		goto error;
 	}
 

  reply	other threads:[~2006-08-15  0:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-15  0:04 drivers/usb/misc/cypress_cy7c63.c: NULL dereference Adrian Bunk
2006-08-15  0:57 ` Greg KH [this message]
2006-08-16 20:51   ` Oliver Bock

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=20060815005749.GA24238@suse.de \
    --to=gregkh@suse.de \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=o.bock@fh-wolfenbuettel.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