mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Pekka J Enberg <penberg@cs.helsinki.fi>
Cc: Greg Kroah-Hartman <greg@kroah.com>,
	Sandro Bonazzola <sandro.bonazzola@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] w35und: fix usb_control_msg() error handling in wb35_probe()
Date: Thu, 22 Jan 2009 12:42:37 +0100	[thread overview]
Message-ID: <20090122114237.GA13845@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <Pine.LNX.4.64.0901221205400.27341@melkki.cs.Helsinki.FI>

> From: Pekka Enberg <penberg@cs.helsinki.fi>
> 
> If successful, the usb_control_msg() function returns the number of
> bytes transferred. Fix up wb35_probe() to only bail out if the function
> returns a negative number.
> 
> Reported-by: Sandro Bonazzola <sandro.bonazzola@gmail.com>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>

Acked-by: Pavel Machek <pavel@suse.cz>

> ---
>  drivers/staging/winbond/wbusb.c |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
> index fd5c8eb..7ced028 100644
> --- a/drivers/staging/winbond/wbusb.c
> +++ b/drivers/staging/winbond/wbusb.c
> @@ -302,17 +302,19 @@ static int wb35_probe(struct usb_interface *intf,
>  	struct usb_device *udev = interface_to_usbdev(intf);
>  	struct wbsoft_priv *priv;
>  	struct ieee80211_hw *dev;
> -	int err;
> +	int err, nr;
>  
>  	usb_get_dev(udev);
>  
>  	/* Check if the device has already been opened */
> -	err = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
> -			      0x01,
> -			      USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
> -			      0x0, 0x400, &ltmp, 4, HZ * 100);
> -	if (err)
> +	nr = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
> +			     0x01,
> +			     USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
> +			     0x0, 0x400, &ltmp, 4, HZ * 100);
> +	if (nr < 0) {
> +		err = nr;
>  		goto error;
> +	}
>  
>  	/* Is already initialized? */
>  	ltmp = cpu_to_le32(ltmp);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2009-01-22 11:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 10:06 Pekka J Enberg
2009-01-22 11:42 ` Pavel Machek [this message]
2009-01-22 19:25   ` Sandro Bonazzola
2009-01-22 21:10     ` Pavel Machek
2009-01-22 21:19       ` Harvey Harrison
2009-01-22 22:32         ` Pekka Enberg
2009-01-22 22:34       ` Sandro Bonazzola
2009-01-22 22:31         ` Pekka Enberg
2009-01-26 19:31           ` Sandro Bonazzola
2009-01-26 19:40             ` Pekka Enberg
2009-01-26 19:43               ` Pekka Enberg
2009-01-26 20:13                 ` Sandro Bonazzola
2009-01-26 20:22                   ` Pekka Enberg
2009-01-26 21:42             ` Pavel Machek
2009-01-22 22:37     ` Pekka Enberg
2009-01-26 17:51 ` Greg KH
2009-01-26 18:03   ` Pekka Enberg
2009-01-26 18:10     ` Pekka Enberg
2009-01-29 19:24       ` Greg KH
2009-01-30  9:32         ` Pekka Enberg

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=20090122114237.GA13845@atrey.karlin.mff.cuni.cz \
    --to=pavel@suse.cz \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=sandro.bonazzola@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

all inboxes | Powered by JetHome®