All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reto Schneider <code@reto-schneider.ch>
To: linux-wireless@vger.kernel.org
Cc: Larry.Finger@lwfinger.net, Reto Schneider <code@reto-schneider.ch>
Subject: [PATCH 3/3] rtl8192cu: Free ieee80211_hw if probing fails
Date: Mon, 22 Jun 2020 15:21:13 +0200	[thread overview]
Message-ID: <20200622132113.14508-4-code@reto-schneider.ch> (raw)
In-Reply-To: <20200622132113.14508-1-code@reto-schneider.ch>

In case of an error, no one will use the allocated structure. Call
ieee80211_free_hw, same as in rtl_usb_disconnect.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 1a9fcb2697bf..d05e709536ea 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1087,6 +1087,7 @@ int rtl_usb_probe(struct usb_interface *intf,
 	usb_put_dev(udev);
 	complete(&rtlpriv->firmware_loading_complete);
 	kfree(rtlpriv->usb_data);
+	ieee80211_free_hw(hw);
 	return -ENODEV;
 }
 EXPORT_SYMBOL(rtl_usb_probe);
-- 
2.20.1


      parent reply	other threads:[~2020-06-22 13:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 13:21 [PATCH 0/3] rtl8192cu: Fixes for leaks and deadlock Reto Schneider
2020-06-22 13:21 ` [PATCH 1/3] rtl8192cu: Fix deadlock Reto Schneider
2020-06-22 18:01   ` Larry Finger
2020-06-23  9:20     ` Kalle Valo
2020-07-15 10:37   ` [PATCH 1/3] rtlwifi: " Kalle Valo
2020-06-22 13:21 ` [PATCH 2/3] rtl8192cu: Prevent leaking urb Reto Schneider
2020-06-22 13:21 ` Reto Schneider [this message]

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=20200622132113.14508-4-code@reto-schneider.ch \
    --to=code@reto-schneider.ch \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.