Skip to contentSkip to conversation

staging: rtl8723bs: hal: Add null check after memory allocation

PATCH New Hariprasad Kelam 1 participant 1 message Jun 16, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: hal: Add null check after memory allocation

Add NULL check post call to rtw_zmalloc.

---
 drivers/staging/rtl8723bs/hal/sdio_ops.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/staging/rtl8723bs/hal/sdio_ops.c +3 -0
index ac79de8..9177c18 100644
@@ -816,6 +816,9 @@ void clearinterrupt8723bsdio(struct adapter *adapter)
 	haldata = GET_HAL_DATA(adapter);
 	clear = rtw_zmalloc(4);
 
+	if (!clear)
+		return;
+
 	/*  Clear corresponding HISR Content if needed */
 	*(__le32 *)clear = cpu_to_le32(haldata->sdio_hisr & MASK_SDIO_HISR_CLEAR);
 	if (*(__le32 *)clear) {
Signature · 1 line
2.7.4