Commit 5492ed9f authored by Wang Jinchao's avatar Wang Jinchao Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192u: Fix keyidx assignment within if condition



Refactor the if condition into nested conditionals to improve clarity.
The condition is currently in the form of (E1 && E2 && E3), where the
variable keyidx is assigned a value in E3.

Signed-off-by: default avatarWang Jinchao <wangjinchao600@gmail.com>
Link: https://lore.kernel.org/r/ZKQ7tYa9I+PHgef/@fedora


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 405f3d10
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1121,11 +1121,13 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,

	/* skb: hdr + (possibly fragmented, possibly encrypted) payload */

	if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
	    (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
	if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP)) {
		keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt);
		if (keyidx < 0) {
			netdev_dbg(ieee->dev, "decrypt frame error\n");
			goto rx_dropped;
		}
	}


	hdr = (struct rtl_80211_hdr_4addr *)skb->data;