staging: ks7010: remove bogus NULL checks
enc->rx_seq[] and enc->key[] are arrays, not pointers and they can't be NULL. Let's remove these NULL checks. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
516a4f04a3
commit
453e102db5
|
@ -1910,11 +1910,8 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
|
||||||
priv->wpa.txkey = index;
|
priv->wpa.txkey = index;
|
||||||
commit |= SME_WEP_INDEX;
|
commit |= SME_WEP_INDEX;
|
||||||
} else if (enc->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
|
} else if (enc->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
|
||||||
if (enc->rx_seq)
|
memcpy(&priv->wpa.key[index].rx_seq[0],
|
||||||
memcpy(&priv->wpa.key[index].rx_seq[0],
|
enc->rx_seq, IW_ENCODE_SEQ_MAX_SIZE);
|
||||||
enc->rx_seq, IW_ENCODE_SEQ_MAX_SIZE);
|
|
||||||
else
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&priv->wpa.key[index].addr.sa_data[0],
|
memcpy(&priv->wpa.key[index].addr.sa_data[0],
|
||||||
|
@ -1935,7 +1932,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
|
||||||
priv->reg.privacy_invoked = 0x01;
|
priv->reg.privacy_invoked = 0x01;
|
||||||
commit |= SME_WEP_FLAG;
|
commit |= SME_WEP_FLAG;
|
||||||
}
|
}
|
||||||
if (enc->key && enc->key_len) {
|
if (enc->key_len) {
|
||||||
memcpy(&priv->wpa.key[index].key_val[0],
|
memcpy(&priv->wpa.key[index].key_val[0],
|
||||||
&enc->key[0], enc->key_len);
|
&enc->key[0], enc->key_len);
|
||||||
priv->wpa.key[index].key_len = enc->key_len;
|
priv->wpa.key[index].key_len = enc->key_len;
|
||||||
|
@ -1947,7 +1944,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
|
||||||
priv->reg.privacy_invoked = 0x01;
|
priv->reg.privacy_invoked = 0x01;
|
||||||
commit |= SME_WEP_FLAG;
|
commit |= SME_WEP_FLAG;
|
||||||
}
|
}
|
||||||
if (enc->key && enc->key_len == 32) {
|
if (enc->key_len == 32) {
|
||||||
memcpy(&priv->wpa.key[index].key_val[0],
|
memcpy(&priv->wpa.key[index].key_val[0],
|
||||||
&enc->key[0], enc->key_len - 16);
|
&enc->key[0], enc->key_len - 16);
|
||||||
priv->wpa.key[index].key_len =
|
priv->wpa.key[index].key_len =
|
||||||
|
|
Loading…
Reference in New Issue