diff options
author | Zheyu Ma <zheyuma97@gmail.com> | 2022-08-18 15:33:52 +0800 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-09-07 11:00:56 +0300 |
commit | 98d3f063be78ca71b578bc3fcf71033a335273db (patch) | |
tree | 3b182ae3e6e257c51211eb0b18481d316d9e8ca8 | |
parent | 5db68fd319583ed3a2b54e4d452b53a66b9d498c (diff) | |
download | linux-98d3f063be78ca71b578bc3fcf71033a335273db.tar.bz2 |
wifi: rtl8xxxu: Simplify the error handling code
Since the logic of the driver's error handling code has changed, the
previous dead store and checks are not needed.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220818073352.3156288-1-zheyuma97@gmail.com
-rw-r--r-- | drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index f3a107f19cf5..862e9c711ac2 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -6657,7 +6657,6 @@ static int rtl8xxxu_probe(struct usb_interface *interface, hw = ieee80211_alloc_hw(sizeof(struct rtl8xxxu_priv), &rtl8xxxu_ops); if (!hw) { ret = -ENOMEM; - priv = NULL; goto err_put_dev; } @@ -6768,11 +6767,9 @@ static int rtl8xxxu_probe(struct usb_interface *interface, err_set_intfdata: usb_set_intfdata(interface, NULL); - if (priv) { - kfree(priv->fw_data); - mutex_destroy(&priv->usb_buf_mutex); - mutex_destroy(&priv->h2c_mutex); - } + kfree(priv->fw_data); + mutex_destroy(&priv->usb_buf_mutex); + mutex_destroy(&priv->h2c_mutex); ieee80211_free_hw(hw); err_put_dev: |