Skip to contentSkip to conversation

wifi: rtl8xxxu: Simplify the error handling code

PATCH In review Zheyu Ma 2 participants 2 messages Aug 18, 2022 – Sep 7, 2022

Subsystems (3)
lore
Share & tools
lore

Zheyu Ma

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +3 -6
index c66f0726b253..e97e35b39225 100644
@@ -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:
Signature · 1 line
2.25.1
#1 lore raw
Quoted 6 lines · Zheyu Ma

Since the logic of the driver's error handling code has changed, the previous dead store and checks are not needed.

Patch applied to wireless-next.git, thanks.

98d3f063be78 wifi: rtl8xxxu: Simplify the error handling code

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches