提交 d7106faa 编写于 作者: H Haowen Bai 提交者: Zheng Zengkai

ipw2x00: Fix potential NULL dereference in libipw_xmit()

stable inclusion
from stable-v5.10.121
commit 98d1dc32f890642476dbb78ed3437a456bf421b0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=98d1dc32f890642476dbb78ed3437a456bf421b0

--------------------------------

[ Upstream commit e8366bba ]

crypt and crypt->ops could be null, so we need to checking null
before dereference
Signed-off-by: NHaowen Bai <baihaowen@meizu.com>
Signed-off-by: NKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1648797055-25730-1-git-send-email-baihaowen@meizu.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 987f1eb3
...@@ -383,7 +383,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -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 /* Each fragment may need to have room for encryption
* pre/postfix */ * pre/postfix */
if (host_encrypt) if (host_encrypt && crypt && crypt->ops)
bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len + bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len +
crypt->ops->extra_mpdu_postfix_len; crypt->ops->extra_mpdu_postfix_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册