From b276eea5e7e5724dbd8efde02ee03789701b8e8f Mon Sep 17 00:00:00 2001 From: Harprit Chhabada Date: Tue, 26 Feb 2019 11:08:57 -0800 Subject: [PATCH] qcacmn: Fix null pointer dereference in send_packetdump netbuf in send_packetdump is never checked for null before dereferencing it for len netbuf->len. Change-Id: I51aa0fb9c52e04c33291791ef47def703754222d CRs-Fixed: 2404844 --- utils/logging/src/wlan_logging_sock_svc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/logging/src/wlan_logging_sock_svc.c b/utils/logging/src/wlan_logging_sock_svc.c index 4d800a34a7b3..5153df37eba2 100644 --- a/utils/logging/src/wlan_logging_sock_svc.c +++ b/utils/logging/src/wlan_logging_sock_svc.c @@ -1346,6 +1346,11 @@ static void send_packetdump(qdf_nbuf_t netbuf, uint8_t status, struct hdd_context *hdd_ctx; struct hdd_adapter *adapter; + if (!netbuf) { + pr_err("%s: Invalid netbuf.\n", __func__); + return; + } + hdd_ctx = (struct hdd_context *)cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) return;