netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
To: Denis Joseph Barrow <public-D.Barow-x9gZzRpC1QbQT0dZR+AlfA@lo.gmane.org>
Cc: Linux USB kernel mailing list
	<public-public-linux-usb-u79uwXL29TY76Z2rM5mHXA-z5DuStaUktnZ+VzJOa5vwg@lo.gmane.org>,
	Greg Kroah-Hartman
	<public-public-gregkh-l3A5Bk7waGM-z5DuStaUktnZ+VzJOa5vwg@lo.gmane.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] hso.c hso_net_open bugfix
Date: Wed, 20 Aug 2008 19:12:20 +0300	[thread overview]
Message-ID: <48AC4264.7030304@teltonika.lt> (raw)
In-Reply-To: <48AC2EA8.1050503@option.com>

Denis Joseph Barrow wrote:
> 
> 
> Hi Paulus & others,
> Sorry I nearly completely agree with you the code can be left as is
> However netdev_priv check is superflous from my understanding of the code,
> admittedly if they changed the netdev_priv function the check might
> become valid.

I agree with you that odev checks in hso_net_open and hso_net_tx_timeout
are pointless and should be removed.

Please add netdev@vger.kernel.org mailing list also.

> Admittedly dev_open would crash if dev!=NULL so I agree with you it
> must be checked further up the stack.
> 
> 
> Paulius Zaleckas wrote:
>>
>> Denis Joseph Barrow wrote:
>>> netdev_priv will return a non NULL pointer even if the net_device
>>> is NULL & cause a crash without this fix.
>> Wrong. If net_device will be NULL hso_net_open won't get called.
>>
>>> Signed-off-by: Denis Joseph Barrow
>>> <D.Barow-x9gZzRpC1QbQT0dZR+AlfA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>> ---
>>> Index: linux-2.6.27-rc3.patch/drivers/net/usb/hso.c
>>> ===================================================================
>>> --- linux-2.6.27-rc3.patch.orig/drivers/net/usb/hso.c    2008-08-20
>>> 12:12:28.000000000 +0200
>>> +++ linux-2.6.27-rc3.patch/drivers/net/usb/hso.c    2008-08-20
>>> 12:26:35.000000000 +0200
>>> @@ -611,14 +611,12 @@
>>>  /* called when net interface is brought up by ifconfig */
>>>  static int hso_net_open(struct net_device *net)
>>>  {
>>> -    struct hso_net *odev = netdev_priv(net);
>>> +    struct hso_net *odev;
>>>      unsigned long flags = 0;
>>>  
>>> -    if (!odev) {
>>> -        dev_err(&net->dev, "No net device !\n");
>>> +    if (!net)
>>>          return -ENODEV;
>>> -    }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

           reply	other threads:[~2008-08-20 16:12 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <48AC2EA8.1050503@option.com>]

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=48AC4264.7030304@teltonika.lt \
    --to=paulius.zaleckas@teltonika.lt \
    --cc=netdev@vger.kernel.org \
    --cc=public-D.Barow-x9gZzRpC1QbQT0dZR+AlfA@lo.gmane.org \
    --cc=public-public-gregkh-l3A5Bk7waGM-z5DuStaUktnZ+VzJOa5vwg@lo.gmane.org \
    --cc=public-public-linux-usb-u79uwXL29TY76Z2rM5mHXA-z5DuStaUktnZ+VzJOa5vwg@lo.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).