* [PATCH] ipw2x00: Fix potential NULL dereference in libipw_xmit()
@ 2022-04-01 7:10 Haowen Bai
2022-04-06 12:14 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-04-01 7:10 UTC (permalink / raw)
To: Stanislav Yakovlev, Kalle Valo, David S. Miller, Jakub Kicinski,
Paolo Abeni
Cc: Haowen Bai, linux-wireless, netdev, linux-kernel
crypt and crypt->ops could be null, so we need to checking null
before dereference
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipw2x00: Fix potential NULL dereference in libipw_xmit()
2022-04-01 7:10 [PATCH] ipw2x00: Fix potential NULL dereference in libipw_xmit() Haowen Bai
@ 2022-04-06 12:14 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-04-06 12:14 UTC (permalink / raw)
To: Haowen Bai
Cc: Stanislav Yakovlev, David S. Miller, Jakub Kicinski, Paolo Abeni,
Haowen Bai, linux-wireless, netdev, linux-kernel
Haowen Bai <baihaowen@meizu.com> wrote:
> crypt and crypt->ops could be null, so we need to checking null
> before dereference
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Patch applied to wireless-next.git, thanks.
e8366bbabe1d ipw2x00: Fix potential NULL dereference in libipw_xmit()
--
https://patchwork.kernel.org/project/linux-wireless/patch/1648797055-25730-1-git-send-email-baihaowen@meizu.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-06 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-01 7:10 [PATCH] ipw2x00: Fix potential NULL dereference in libipw_xmit() Haowen Bai
2022-04-06 12:14 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).