Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fb1b9be authored by Haowen Bai's avatar Haowen Bai Committed by Greg Kroah-Hartman
Browse files

ipw2x00: Fix potential NULL dereference in libipw_xmit()



[ Upstream commit e8366bbabe1d207cf7c5b11ae50e223ae6fc278b ]

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

Signed-off-by: default avatarHaowen Bai <baihaowen@meizu.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1648797055-25730-1-git-send-email-baihaowen@meizu.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 30338091
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;