[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100420.180501.08643239.davem@davemloft.net>
Date: Tue, 20 Apr 2010 18:05:01 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: wg@...ndegger.com
Cc: hjk@...utronix.de, netdev@...r.kernel.org,
socketcan-core@...ts.berlios.de
Subject: Re: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c
From: Wolfgang Grandegger <wg@...ndegger.com>
Date: Tue, 20 Apr 2010 21:47:37 +0200
> Hans J. Koch wrote:
>> In ems_usb_probe(), a pointer is dereferenced after making sure it is NULL...
>>
>> This patch replaces dev_err() with printk() to avoid this.
>>
>> Signed-off-by: "Hans J. Koch" <hjk@...utronix.de>
>> ---
>> drivers/net/can/usb/ems_usb.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Index: linux-2.6.34-rc/drivers/net/can/usb/ems_usb.c
>> ===================================================================
>> --- linux-2.6.34-rc.orig/drivers/net/can/usb/ems_usb.c 2010-04-20 15:32:25.000000000 +0200
>> +++ linux-2.6.34-rc/drivers/net/can/usb/ems_usb.c 2010-04-20 15:33:20.000000000 +0200
>> @@ -1006,7 +1006,7 @@
>>
>> netdev = alloc_candev(sizeof(struct ems_usb), MAX_TX_URBS);
>> if (!netdev) {
>> - dev_err(netdev->dev.parent, "Couldn't alloc candev\n");
>> + printk(KERN_ERR "ems_usb: Couldn't alloc candev\n");
>> return -ENOMEM;
>> }
>
> I think "dev_err(&intf->dev, ...)" should be used before
> SET_NETDEV_DEV(netdev, &intf->dev) is called. I see two "dev_err()"
> calls which need to be fixed.
Agreed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists