From e17a5d9251fc07972dc8ee5d1ca363bc3d07cbad Mon Sep 17 00:00:00 2001 From: Wenxiu Han Date: Mon, 14 Sep 2020 17:43:55 +0800 Subject: [PATCH] qcacmn: Check null pointer before use In API hif_batch_send(), the variable ce_tx_hdl is dereferenced in if_batch_send() without null check. Check for null before use to avoid dereference a NULL pointer. Change-Id: I05c38e180a448522d13d68369b77b45314eac227 CRs-Fixed: 2968584 --- hif/src/hif_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 55723e7895..b5140cc1e5 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -1947,6 +1947,9 @@ qdf_nbuf_t hif_batch_send(struct hif_opaque_softc *osc, qdf_nbuf_t msdu, { void *ce_tx_hdl = hif_get_ce_handle(osc, CE_HTT_TX_CE); + if (!ce_tx_hdl) + return NULL; + return ce_batch_send((struct CE_handle *)ce_tx_hdl, msdu, transfer_id, len, sendhead); }