Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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

authored by

Haowen Bai and committed by
Kalle Valo
e8366bba 11800d89

+1 -1
+1 -1
drivers/net/wireless/intel/ipw2x00/libipw_tx.c
··· 383 383 384 384 /* Each fragment may need to have room for encryption 385 385 * pre/postfix */ 386 - if (host_encrypt) 386 + if (host_encrypt && crypt && crypt->ops) 387 387 bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len + 388 388 crypt->ops->extra_mpdu_postfix_len; 389 389