diff options
author | Matteo Semenzato <mattew8898@gmail.com> | 2015-03-11 14:31:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-16 15:48:20 +0100 |
commit | 66faa441a6f5753dd3e7add3e1640819ba9ec1c2 (patch) | |
tree | 403e4df6cb43ef4c84227f1232260e553a64d4f8 /drivers/staging/rtl8712 | |
parent | 819ef638151f89199c6c3ce42418f40be90ff23a (diff) | |
download | talos-obmc-linux-66faa441a6f5753dd3e7add3e1640819ba9ec1c2.tar.gz talos-obmc-linux-66faa441a6f5753dd3e7add3e1640819ba9ec1c2.zip |
Staging: rtl8712: fix potential null pointer dereference
Check if kmalloc succeded before using the pointer in memcpy.
Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_mlme.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index 9b13de1437a1..fb2b195b90af 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -725,6 +725,8 @@ void r8712_joinbss_event_callback(struct _adapter *adapter, u8 *pbuf) if (sizeof(struct list_head) == 4 * sizeof(u32)) { pnetwork = kmalloc(sizeof(struct wlan_network), GFP_ATOMIC); + if (!pnetwork) + return; memcpy((u8 *)pnetwork+16, (u8 *)pbuf + 8, sizeof(struct wlan_network) - 16); } else |