projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2af5f66
)
staging: wilc1000: add check for kmalloc allocation failure.
author
Colin Ian King
<
[email protected]
>
Tue, 28 Feb 2017 11:47:33 +0000
(11:47 +0000)
committer
Greg Kroah-Hartman
<
[email protected]
>
Mon, 6 Mar 2017 08:17:08 +0000
(09:17 +0100)
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 <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/staging/wilc1000/host_interface.c
patch
|
blob
|
history
diff --git
a/drivers/staging/wilc1000/host_interface.c
b/drivers/staging/wilc1000/host_interface.c
index c2a3424c35cb2ee0c66bceae1932ec343f9774f8..f848bb85ff1fa8206f21a46b675fc7af3ac2c103 100644
(file)
--- a/
drivers/staging/wilc1000/host_interface.c
+++ b/
drivers/staging/wilc1000/host_interface.c
@@
-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);