Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-13 15:52:45 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-15 11:46:07 +0200
commit70671fe95cb836e45074889e78f8a52717d2e3aa (patch)
tree0b7a18a3b8fcf2333f46d1b4743039d386d48f2e
parenta6b6409d8418f21589af3f7c65570a3375ce6ee3 (diff)
staging: rtlwifi: Fix potential NULL pointer dereference of
kzalloc (bsc#1111666).
-rw-r--r--patches.drivers/staging-rtlwifi-Fix-potential-NULL-pointer-dereferen.patch37
-rw-r--r--series.conf1
2 files changed, 38 insertions, 0 deletions
diff --git a/patches.drivers/staging-rtlwifi-Fix-potential-NULL-pointer-dereferen.patch b/patches.drivers/staging-rtlwifi-Fix-potential-NULL-pointer-dereferen.patch
new file mode 100644
index 0000000000..babd2c0cd8
--- /dev/null
+++ b/patches.drivers/staging-rtlwifi-Fix-potential-NULL-pointer-dereferen.patch
@@ -0,0 +1,37 @@
+From 6a8ca24590a2136921439b376c926c11a6effc0e Mon Sep 17 00:00:00 2001
+From: Aditya Pakki <pakki001@umn.edu>
+Date: Wed, 20 Mar 2019 10:42:32 -0500
+Subject: [PATCH] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc
+Git-commit: 6a8ca24590a2136921439b376c926c11a6effc0e
+Patch-mainline: v5.1-rc3
+References: bsc#1111666
+
+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>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/staging/rtlwifi/phydm/rtl_phydm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/staging/rtlwifi/phydm/rtl_phydm.c b/drivers/staging/rtlwifi/phydm/rtl_phydm.c
+index 9930ed954abb..4cc77b2016e1 100644
+--- a/drivers/staging/rtlwifi/phydm/rtl_phydm.c
++++ b/drivers/staging/rtlwifi/phydm/rtl_phydm.c
+@@ -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);
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 3c085f9b4b..366c144454 100644
--- a/series.conf
+++ b/series.conf
@@ -45486,6 +45486,7 @@
patches.drivers/staging-rtl8188eu-Fix-potential-NULL-pointer-derefer.patch
patches.drivers/staging-rtlwifi-rtl8822b-fix-to-avoid-potential-NULL.patch
patches.drivers/staging-rtl8712-uninitialized-memory-in-read_bbreg_h.patch
+ patches.drivers/staging-rtlwifi-Fix-potential-NULL-pointer-dereferen.patch
patches.drivers/staging-vt6655-Fix-interrupt-race-condition-on-devic.patch
patches.drivers/staging-vt6655-Remove-vif-check-from-vnt_interrupt.patch
patches.drivers/gpio-adnp-Fix-testing-wrong-value-in-adnp_gpio_direc.patch