From 0f345aee166f264f70e70735f847f099debac604 Mon Sep 17 00:00:00 2001 From: Akshay Kosigi Date: Mon, 23 Apr 2018 16:27:10 +0530 Subject: [PATCH] qcacmn: Fix for NULL check reference in hif_get_hal_handle() Fixe for Null check dereferencing pointers Change-Id: I706b5959a85ab381594d7cab7e7dba95435f85f5 CRs-Fixed: 2230161 --- hif/src/hif_main.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index 517a28d38295..81d334c4f2a3 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -210,6 +210,10 @@ struct hif_softc { static inline void *hif_get_hal_handle(void *hif_hdl) { struct hif_softc *sc = (struct hif_softc *)hif_hdl; + + if (!sc) + return NULL; + return sc->hal_soc; }