public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft•net>
To: wg@grandegger•com
Cc: hjk@linutronix•de, netdev@vger•kernel.org,
	socketcan-core@lists•berlios.de
Subject: Re: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c
Date: Tue, 20 Apr 2010 18:05:01 -0700 (PDT)	[thread overview]
Message-ID: <20100420.180501.08643239.davem@davemloft.net> (raw)
In-Reply-To: <4BCE04D9.2030601@grandegger.com>

From: Wolfgang Grandegger <wg@grandegger•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@linutronix•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.

  reply	other threads:[~2010-04-21  1:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 13:55 [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c Hans J. Koch
     [not found] ` <20100420135538.GA1994-hikPBsva6T+Nj9Bq2fkWzw@public.gmane.org>
2010-04-20 19:47   ` Wolfgang Grandegger
2010-04-21  1:05     ` David Miller [this message]
     [not found]       ` <20100420.180501.08643239.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2010-04-21 10:18         ` Hans J. Koch
     [not found]           ` <20100421101805.GA1995-hikPBsva6T+Nj9Bq2fkWzw@public.gmane.org>
2010-04-21 10:27             ` Wolfgang Grandegger
2010-04-21 23:15               ` David Miller

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=20100420.180501.08643239.davem@davemloft.net \
    --to=davem@davemloft$(echo .)net \
    --cc=hjk@linutronix$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=socketcan-core@lists$(echo .)berlios.de \
    --cc=wg@grandegger$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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