mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
staging: wilc1000: add check for kmalloc allocation failure.
Add a sanity check that wid.val has been allocated, fixes a null
pointer deference on stamac when calling ether_add_copy.
Detected by CoverityScan, CID#1369537 ("Dereference null return value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2af5f669be
commit
6cc0c259d0
1 changed files with 2 additions and 0 deletions
|
|
@ -1928,6 +1928,8 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
|
|||
wid.type = WID_STR;
|
||||
wid.size = ETH_ALEN;
|
||||
wid.val = kmalloc(wid.size, GFP_KERNEL);
|
||||
if (!wid.val)
|
||||
return -ENOMEM;
|
||||
|
||||
stamac = wid.val;
|
||||
ether_addr_copy(stamac, strHostIfStaInactiveT->mac);
|
||||
|
|
|
|||
Loading…
Reference in a new issue