1 From 70a3605d6d1922411b8a78499d58f140565353f7 Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Wed, 29 Jun 2016 14:42:18 -0400
4 Subject: [PATCH] rtl8xxxu: Fix error handling if rtl8xxxu_init_device() fails
6 For some reason we lost the code bailing if rtl8xxxu_init_device()
9 This catches the error and also cleans up the error handling.
11 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
13 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 20 +++++++++++++++++---
14 1 file changed, 17 insertions(+), 3 deletions(-)
16 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
17 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
18 @@ -5947,7 +5947,7 @@ static int rtl8xxxu_probe(struct usb_int
19 struct ieee80211_hw *hw;
20 struct usb_device *udev;
21 struct ieee80211_supported_band *sband;
26 udev = usb_get_dev(interface_to_usbdev(interface));
27 @@ -5995,6 +5995,7 @@ static int rtl8xxxu_probe(struct usb_int
28 hw = ieee80211_alloc_hw(sizeof(struct rtl8xxxu_priv), &rtl8xxxu_ops);
35 @@ -6043,6 +6044,8 @@ static int rtl8xxxu_probe(struct usb_int
38 ret = rtl8xxxu_init_device(hw);
42 hw->wiphy->max_scan_ssids = 1;
43 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
44 @@ -6093,9 +6096,20 @@ static int rtl8xxxu_probe(struct usb_int
53 + usb_set_intfdata(interface, NULL);
56 + kfree(priv->fw_data);
57 + mutex_destroy(&priv->usb_buf_mutex);
58 + mutex_destroy(&priv->h2c_mutex);
62 + ieee80211_free_hw(hw);