lkml.org 
[lkml]   [2006]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: drivers/usb/misc/cypress_cy7c63.c: NULL dereference
    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;
    }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2006-08-15 03:01    [W:2.146 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site