OSDN Git Service

rsi: Fix NULL pointer dereference in kmalloc
authorAditya Pakki <pakki001@umn.edu>
Sat, 23 Mar 2019 20:49:16 +0000 (15:49 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:15 +0000 (06:46 -0700)
commiteacec4367998f647f172383c5008e727967a06c7
tree6473c1b8baf515bbf62891f556d5a75760187ba5
parent9d54cca8f9395c6419b025f106b4c44099780389
rsi: Fix NULL pointer dereference in kmalloc

[ Upstream commit d5414c2355b20ea8201156d2e874265f1cb0d775 ]

kmalloc can fail in rsi_register_rates_channels but memcpy still attempts
to write to channels. The patch replaces these calls with kmemdup and
passes the error upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/rsi/rsi_91x_mac80211.c