Skip to contentSkip to conversation

Patch "staging: wilc1000: add check for kmalloc allocation failure." has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Mar 19, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

staging: wilc1000: add check for kmalloc allocation failure.

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
staging-wilc1000-add-check-for-kmalloc-allocation-failure.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Mar 19 09:58:12 CET 2018

From: Colin Ian King <[email protected]>
Date: Tue, 28 Feb 2017 11:47:33 +0000
Subject: staging: wilc1000: add check for kmalloc allocation failure.

From: Colin Ian King <[email protected]>

[ Upstream commit 6cc0c259d034c6ab48f4e12f505213988e73d380 ]

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")

---
 drivers/staging/wilc1000/host_interface.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/staging/wilc1000/host_interface.c +2 -0
@@ -2179,6 +2179,8 @@ static s32 Handle_Get_InActiveTime(struc
 	wid.type = WID_STR;
 	wid.size = ETH_ALEN;
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
+	if (!wid.val)
+		return -ENOMEM;
 
 	stamac = wid.val;
 	memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/staging-wilc1000-add-check-for-kmalloc-allocation-failure.patch