diff options
author | Haowen Bai <[email protected]> | 2022-04-01 15:10:54 +0800 |
---|---|---|
committer | Kalle Valo <[email protected]> | 2022-04-06 15:14:44 +0300 |
commit | e8366bbabe1d207cf7c5b11ae50e223ae6fc278b (patch) | |
tree | 68c9618edac84c13b512ba5ee18f83db6d22efc3 | |
parent | 11800d893b38e0e12d636c170c1abc19c43c730c (diff) |
ipw2x00: Fix potential NULL dereference in libipw_xmit()
crypt and crypt->ops could be null, so we need to checking null
before dereference
Signed-off-by: Haowen Bai <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c index 36d1e6b2568d..4aec1fce1ae2 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c @@ -383,7 +383,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev) /* Each fragment may need to have room for encryption * pre/postfix */ - if (host_encrypt) + if (host_encrypt && crypt && crypt->ops) bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len + crypt->ops->extra_mpdu_postfix_len; |