drivers/usb/misc/cypress_cy7c63.c: NULL dereference
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 -->
cu
Adrian
Signature · 6 lines
Gentoo kernels are 42 times more popular than SUSE kernels among
KLive users (a service by SUSE contractor Andrea Arcangeli that
gathers data about kernels from many users worldwide).
There are three kinds of lies: Lies, Damn Lies, and Statistics.
Benjamin DisraeliQuoted 13 lines · Adrian Bunk
The Coverity Checker spotted the following obvious NULL dereference:
<-- snip -->
...
static int cypress_probe(structusb_interface*interface,
const structusb_device_id*id)
{
...if (dev == NULL) { dev_err(&dev->udev->dev, "Out of memory!\n"); goto error; }
Quoted 5 lines
...
}
...<-- snip -->
Thanks for letting me know, the patch below should fix this.
greg k-h
------------
From: Greg Kroah-Hartman <[email protected]>
Subject: USB: fix bug in cypress_cy7c63.c driver
This was pointed out by Adrian Bunk <[email protected]>, as found by the Coverity Checker.
--- drivers/usb/misc/cypress_cy7c63.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/cypress_cy7c63.c +1 -1
@@ -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; }
Thanks guys!
Sorry for that blunder...
Oliver
Quoted 51 lines · Greg KH
Quoted 13 lines · Adrian Bunk
The Coverity Checker spotted the following obvious NULL dereference:
<-- snip -->
...
static int cypress_probe(structusb_interface*interface,
const structusb_device_id*id)
{
...if (dev == NULL) { dev_err(&dev->udev->dev, "Out of memory!\n"); goto error; }Quoted 5 lines
...
}
...<-- snip -->
Thanks for letting me know, the patch below should fix this.
greg k-h
------------
From: Greg Kroah-Hartman <[email protected]>
Subject: USB: fix bug incypress_cy7c63.cdriverThis was pointed out by Adrian Bunk <[email protected]>, as found by the Coverity Checker.
Cc Adrian Bunk <[email protected]>Cc Oliver Bock <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/usb/misc/cypress_cy7c63.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/misc/cypress_cy7c63.c +1
-1@@ -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; }