Skip to contentSkip to conversation

rtlwifi: remove redundant assignment to variable err

PATCH In review Colin King 2 participants 2 messages Mar 27, 2021 – Apr 17, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 rtlwifi: remove redundant assignment to variable err

From: Colin Ian King <[email protected]>

Variable err is assigned -ENODEV followed by an error return path via label error_out that does not access the variable and returns with the -ENODEV error return code. The assignment to err is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -1
index 6c5e242b1bc5..37a9a03123f3 100644
@@ -1070,7 +1070,6 @@ int rtl_usb_probe(struct usb_interface *intf,
 	err = ieee80211_register_hw(hw);
 	if (err) {
 		pr_err("Can't register mac80211 hw.\n");
-		err = -ENODEV;
 		goto error_out;
 	}
 	rtlpriv->mac80211.mac80211_registered = 1;
Signature · 1 line
2.30.2
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

Variable err is assigned -ENODEV followed by an error return path via label error_out that does not access the variable and returns with the -ENODEV error return code. The assignment to err is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Patch applied to wireless-drivers-next.git, thanks.

87431bc1f0f6 rtlwifi: remove redundant assignment to variable err

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

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