LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pekka J Enberg <penberg@cs.helsinki.fi>
To: greg@kroah.com
Cc: pavel@suse.cz, linux-kernel@vger.kernel.org
Subject: [PATCH] w35und: usb_put_dev() is missing from wb35_disconnect()
Date: Mon, 27 Oct 2008 23:29:31 +0200 (EET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0810272328430.8946@melkki.cs.Helsinki.FI> (raw)

From: Pekka Enberg <penberg@cs.helsinki.fi>

The wb35_probe() function does usb_get_dev() so add a missing usb_put_dev() to
the wb35_disconnect() function. Also fix error handling paths in wb35_probe()
to call usb_put_dev() as well.

Cc: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 drivers/staging/winbond/linux/wbusb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/winbond/linux/wbusb.c b/drivers/staging/winbond/linux/wbusb.c
index 582ede4..128b70a 100644
--- a/drivers/staging/winbond/linux/wbusb.c
+++ b/drivers/staging/winbond/linux/wbusb.c
@@ -277,6 +277,7 @@ error_free_hw:
 error_free_adapter:
 	kfree(adapter);
 error:
+	usb_put_dev(udev);
 	return err;
 }
 
@@ -310,12 +311,12 @@ void packet_came(char *pRxBufferAddress, int PacketSize)
 
 static void wb35_disconnect(struct usb_interface *intf)
 {
-	struct wb35_adapter * adapter = usb_get_intfdata(intf);
-	usb_set_intfdata(intf, NULL);
+	struct wb35_adapter *adapter = usb_get_intfdata(intf);
 
-	// Card remove
 	WbWlanHalt(adapter);
 
+	usb_set_intfdata(intf, NULL);
+	usb_put_dev(interface_to_usbdev(intf));
 }
 
 static struct usb_driver wb35_driver = {
-- 
1.5.3.7


             reply	other threads:[~2008-10-27 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 21:29 Pekka J Enberg [this message]
2008-10-28 19:27 ` Pavel Machek

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=Pine.LNX.4.64.0810272328430.8946@melkki.cs.Helsinki.FI \
    --to=penberg@cs.helsinki.fi \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --subject='Re: [PATCH] w35und: usb_put_dev() is missing from wb35_disconnect()' \
    /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

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).