diff options
author | Wang Jinchao <wangjinchao600@gmail.com> | 2023-07-04 23:33:09 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-27 10:00:02 +0200 |
commit | 5492ed9f8fb07bf42a489fd11199ed3c614d6c71 (patch) | |
tree | 21c475182646d1165720606f862c7781635b01f6 /drivers/staging/rtl8192u | |
parent | 405f3d102c465d329195e0046daf8121b4ab9998 (diff) |
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: Wang Jinchao <wangjinchao600@gmail.com>
Link: https://lore.kernel.org/r/ZKQ7tYa9I+PHgef/@fedora
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index ca09367005e1..5da8ac401df0 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -1121,10 +1121,12 @@ 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) { - netdev_dbg(ieee->dev, "decrypt frame error\n"); - goto rx_dropped; + 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; + } } |