Skip to content

Commit

Permalink
ipw2x00: Fix potential NULL dereference in libipw_xmit()
Browse files Browse the repository at this point in the history
[ Upstream commit e8366bb ]

crypt and crypt->ops could be null, so we need to checking null
before dereference

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1648797055-25730-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Lotte-Bai authored and gregkh committed Jun 9, 2022
1 parent 866947e commit 5f7ea27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/ipw2x00/libipw_tx.c
Expand Up @@ -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;

Expand Down

0 comments on commit 5f7ea27

Please sign in to comment.