mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc
[ Upstream commit 6a8ca24590 ]
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c5750b45e4
commit
f85682bc59
@@ -180,6 +180,8 @@ static int rtl_phydm_init_priv(struct rtl_priv *rtlpriv,
|
||||
|
||||
rtlpriv->phydm.internal =
|
||||
kzalloc(sizeof(struct phy_dm_struct), GFP_KERNEL);
|
||||
if (!rtlpriv->phydm.internal)
|
||||
return 0;
|
||||
|
||||
_rtl_phydm_init_com_info(rtlpriv, ic, params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user