[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1400621573-7672-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Date: Tue, 20 May 2014 23:32:53 +0200
From: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Xenia Ragiadakou <burzalodowa@...il.com>
Cc: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@...el.com>,
Ana Rey <anarey@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8192u: r8192U_core.c: Fix for possible null pointer dereference
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
---
drivers/staging/rtl8192u/r8192U_core.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 1bb6143..7bd58ee 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2038,9 +2038,9 @@ static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI, EDCAPARA_VO}
static void rtl8192_qos_activate(struct work_struct *work)
{
struct r8192_priv *priv = container_of(work, struct r8192_priv, qos_activate);
- struct net_device *dev = priv->ieee80211->dev;
- struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters;
- u8 mode = priv->ieee80211->current_network.mode;
+ struct net_device *dev;
+ struct ieee80211_qos_parameters *qos_parameters;
+ u8 mode;
u8 u1bAIFS;
u32 u4bAcParam;
int i;
@@ -2048,6 +2048,10 @@ static void rtl8192_qos_activate(struct work_struct *work)
if (priv == NULL)
return;
+ dev = priv->ieee80211->dev;
+ qos_parameters = &priv->ieee80211->current_network.qos_data.parameters;
+ mode = priv->ieee80211->current_network.mode;
+
mutex_lock(&priv->mutex);
if (priv->ieee80211->state != IEEE80211_LINKED)
goto success;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists