Thread (4 messages) 4 messages, 3 authors, 2018-01-08

Re: [PATCH] mt76: fix memcpy to potential null pointer on failed allocation

flat view

From: Felix Fietkau <nbd@nbd.name>
Date: 2017-12-14 10:17:54
Also in: kernel-janitors, linux-arm-kernel, linux-mediatek, linux-wireless, lkml

On 2017-12-14 11:13, Colin King wrote:
From: Colin Ian King <redacted>

Currently if the allocation of skb fails and returns NULL then the
call to skb_put will cause a null pointer dereference. Fix this by
checking for a null skb and returning NULL.  Note that calls to
function mt76x2_mcu_msg_alloc don't directly check the null return
but instead pass the NULL pointer to mt76x2_mcu_msg_send which
checks for the NULL and returns ENOMEM in this case.

Detected by CoverityScan, CID#1462624 ("Dereference null return value")

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Colin Ian King <redacted>
Acked-by: Felix Fietkau <nbd@nbd.name>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help