Commit 0840ff76 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: rtl8192u: remove redundant null check on array alg

u.crypt.alg is an array of u8 integers and hence the null check on
this array is redundant and can be removed.

Detected with CoverityScan, CID#143214 ("Array compared against 0")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7a976ce1
...@@ -3056,7 +3056,6 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ...@@ -3056,7 +3056,6 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
} else } else
sec.flags &= ~SEC_ACTIVE_KEY; sec.flags &= ~SEC_ACTIVE_KEY;
if (param->u.crypt.alg != NULL) {
memcpy(sec.keys[param->u.crypt.idx], memcpy(sec.keys[param->u.crypt.idx],
param->u.crypt.key, param->u.crypt.key,
param->u.crypt.key_len); param->u.crypt.key_len);
...@@ -3073,7 +3072,6 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ...@@ -3073,7 +3072,6 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
sec.flags |= SEC_LEVEL; sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_3; sec.level = SEC_LEVEL_3;
} }
}
done: done:
if (ieee->set_security) if (ieee->set_security)
ieee->set_security(ieee->dev, &sec); ieee->set_security(ieee->dev, &sec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment