Staging: rtl8723bs: Add missing NULL check for kmalloc
authorMadhumitha Prabakaran <madhumithabiw@gmail.com>
Mon, 18 Mar 2019 23:12:36 +0000 (18:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Mar 2019 13:32:35 +0000 (14:32 +0100)
Include missing NULL check for kmalloc in function rtw_init_evt_priv.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_cmd.c

index 9edd0dda3c06eb48c28e698c38ce0554c09a5f2f..bd3a5a23a418b07fa70cec34711612f28655beed 100644 (file)
@@ -210,6 +210,8 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)
        _init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL);
        pevtpriv->c2h_wk_alive = false;
        pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1);
+       if (!pevtpriv->c2h_queue)
+               return -ENOMEM;
 
        return 0;
 }