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:20:17 +0000 (09:20 +0200)
commitf85682bc594ad483ae98c6391ea3bceeeedf9c86
treec8a2e92568e55f532304b05b573ee732e5943923
parentc5750b45e406216aaa7e4fcfe102f21ce402af46
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