linux/drivers/net/wireless/mediatek/mt76
Colin Ian King 364bea50db mt76: fix memcpy to potential null pointer on failed allocation
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: 7bc04215a6 ("mt76: add driver code for MT76x2e")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-01-08 19:27:44 +02:00
..
debugfs.c mt76: fix debugfs_simple_attr.cocci warnings 2018-01-08 19:25:46 +02:00
dma.c
dma.h
eeprom.c
Kconfig
mac80211.c
Makefile
mmio.c
mt76.h
mt76x2.h
mt76x2_core.c
mt76x2_debugfs.c
mt76x2_dfs.c
mt76x2_dfs.h
mt76x2_dma.c
mt76x2_dma.h
mt76x2_eeprom.c mt76x2: initialize channel power limits at probe time 2018-01-08 19:25:50 +02:00
mt76x2_eeprom.h mt76x2: initialize channel power limits at probe time 2018-01-08 19:25:50 +02:00
mt76x2_init.c mt76x2: init: fix rx filter default value during init 2018-01-08 19:25:56 +02:00
mt76x2_mac.c mt76x2: remove some harmless WARN_ONs in tx status and rx path 2018-01-08 19:25:47 +02:00
mt76x2_mac.h
mt76x2_main.c mt76x2: configure rx filter based on monitor mode setting 2018-01-08 19:25:55 +02:00
mt76x2_mcu.c mt76: fix memcpy to potential null pointer on failed allocation 2018-01-08 19:27:44 +02:00
mt76x2_mcu.h
mt76x2_pci.c
mt76x2_phy.c mt76x2: initialize channel power limits at probe time 2018-01-08 19:25:50 +02:00
mt76x2_regs.h
mt76x2_trace.c
mt76x2_trace.h
mt76x2_tx.c
trace.c
trace.h
tx.c
util.c
util.h