staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc
authorAditya Pakki <pakki001@umn.edu>
Wed, 20 Mar 2019 15:42:32 +0000 (10:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2019 07:15:20 +0000 (09:15 +0200)
commitd1e7cfba1e8952b4d7f03d7acb14822c29f743e5
tree7aa38a4167143af37ceba5dc4152278539d5c382
parent9db1d06bd4ada8ffd0605cc31daca8f410aa7548
staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

[ Upstream commit 6a8ca24590a2136921439b376c926c11a6effc0e ]

phydm.internal is allocated using kzalloc which is used multiple
times without a check for NULL pointer. This patch avoids such a
scenario by returning 0, consistent with the failure case.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
drivers/staging/rtlwifi/phydm/rtl_phydm.c