netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Richard Cochran <richardcochran@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] usbnet: drop unneeded check for NULL
Date: Tue, 04 Sep 2012 18:13:18 +0200	[thread overview]
Message-ID: <20747715.9FmHp7X6VE@linux-lqwf.site> (raw)
In-Reply-To: <20120904155343.GA2170@netboy.at.omicron.at>

On Tuesday 04 September 2012 17:53:43 Richard Cochran wrote:
> On Tue, Sep 04, 2012 at 04:21:54PM +0200, Oliver Neukum wrote:
> > usbnet_start_xmit() is always called with a valid skb
> 
> So, has the problem that this test worked around been fixed?

netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
                                     struct net_device *net)
{
        struct usbnet           *dev = netdev_priv(net);
        int                     length;
        struct urb              *urb = NULL;
        struct skb_data         *entry;
        struct driver_info      *info = dev->driver_info;
        unsigned long           flags;
        int retval;

        if (skb)
                skb_tx_timestamp(skb);

        // some devices want funky USB-level framing, for
        // win32 driver (usually) and/or hardware quirks
        if (info->tx_fixup) {
                skb = info->tx_fixup (dev, skb, GFP_ATOMIC);
                if (!skb) {
                        if (netif_msg_tx_err(dev)) {
                                netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n");
                                goto drop;
                        } else {
                                /* cdc_ncm collected packet; waits for more */
                                goto not_drop;
                        }
                }
        }
        length = skb->len;

If that check is ever needed and tx_fixup not needed, the driver will oops here.
The check is wrong in any case.

	Regards
		Oliver
 

  reply	other threads:[~2012-09-04 16:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 14:21 [PATCH] usbnet: drop unneeded check for NULL Oliver Neukum
2012-09-04 15:53 ` Richard Cochran
2012-09-04 16:13   ` Oliver Neukum [this message]
2012-09-04 16:37     ` David Miller
2012-09-05  4:47       ` Richard Cochran
2012-09-05  6:24         ` Oliver Neukum
2012-09-05 16:50           ` David Miller
2012-09-05 22:14             ` Ben Hutchings
2012-09-05 22:34               ` Oliver Neukum
2012-09-05 22:53                 ` Ben Hutchings
2012-09-06  7:52               ` Richard Cochran

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=20747715.9FmHp7X6VE@linux-lqwf.site \
    --to=oliver@neukum.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /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).