From: Colin Ian King Date: Fri, 4 Oct 2019 16:02:27 +0000 (+0100) Subject: ath10k: fix null dereference on pointer crash_data X-Git-Tag: v5.5-rc1~174^2~78^2~48^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a69d3bdd4d40c8f780c94b5e1983adb1cd389b59;p=thirdparty%2Fkernel%2Flinux.git ath10k: fix null dereference on pointer crash_data Currently when pointer crash_data is null the present null check will also check that crash_data->ramdump_buf is null and will cause a null pointer dereference on crash_data. Fix this by using the || operator instead of &&. Fixes: 3f14b73c3843 ("ath10k: Enable MSA region dump support for WCN3990") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index cd22c8654aa9c..16177497bba76 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1400,7 +1400,7 @@ static void ath10k_msa_dump_memory(struct ath10k *ar, size_t buf_len; u8 *buf; - if (!crash_data && !crash_data->ramdump_buf) + if (!crash_data || !crash_data->ramdump_buf) return; mem_layout = ath10k_coredump_get_mem_layout(ar);