lkml.org 
[lkml]   [2019]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] staging: rtl8723bs: hal: Add null check after memory allocation
Add NULL check post call to rtw_zmalloc.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
drivers/staging/rtl8723bs/hal/sdio_ops.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index ac79de8..9177c18 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -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) {
--
2.7.4
\
 
 \ /
  Last update: 2019-06-16 05:15    [W:0.037 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site