From patchwork Sun Dec 14 22:39:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5489431 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 544F59F326 for ; Sun, 14 Dec 2014 22:36:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4042B20A09 for ; Sun, 14 Dec 2014 22:36:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 517A120A01 for ; Sun, 14 Dec 2014 22:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbaLNWgj (ORCPT ); Sun, 14 Dec 2014 17:36:39 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:58003 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbaLNWgd (ORCPT ); Sun, 14 Dec 2014 17:36:33 -0500 Received: by mail-wg0-f49.google.com with SMTP id n12so13199960wgh.36 for ; Sun, 14 Dec 2014 14:36:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=On3otmkD2Cdtehzz654UD6q7zlEFOqbGFPUoewKumqI=; b=lqCbe0lG3YiGdy7RTj3d7lHImYidxrG8r52YCLoj0s5aZRFnQj1Frl9xqMn8q8SkrT rNUs+H+11fU5cjjK7+2INuid9BwOKNrWQ4FFWsOwuwPisoMxjL2xBRA9CqsdoIIgiY1i nVkpTr3m0NCfqsic/5ftGrHRz4a4axmRYwknxIp0ATdNqSydWqi74+TlJPNE7Dftw7Rn a2VtcSyZZdZFDo1sKeJMT/s/iuK8QlFxfQc7aAZQlX+BGlv/pgZPI381FrwPhEIgiJ7E P1fIfFM+PdnCDqazcqq2QZiwR7vAT3DtPRE2Rtf1bKz0K3Eqj0bhaSPjlCh3fJJ7twcn yGow== X-Gm-Message-State: ALoCoQm+zisbErHOawmxfcsduTqoAbnafwCqkqljUIObq5CrUfF3M4GvSI3WK//sXkFINWGt+Mfi X-Received: by 10.194.120.164 with SMTP id ld4mr47020512wjb.67.1418596591395; Sun, 14 Dec 2014 14:36:31 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id bs2sm10741461wjc.43.2014.12.14.14.36.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Dec 2014 14:36:30 -0800 (PST) From: Rickard Strandqvist To: Larry Finger , Jes Sorensen Cc: Rickard Strandqvist , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference Date: Sun, 14 Dec 2014 23:39:14 +0100 Message-Id: <1418596754-24735-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/staging/rtl8723au/os_dep/usb_intf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c index 865743e..71a6330 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c @@ -351,10 +351,11 @@ error_exit: int rtw_hw_resume23a(struct rtw_adapter *padapter) { struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; - struct net_device *pnetdev = padapter->pnetdev; + struct net_device *pnetdev; if (padapter) { /* system resume */ DBG_8723A("==> rtw_hw_resume23a\n"); + pnetdev = padapter->pnetdev; down(&pwrpriv->lock); pwrpriv->bips_processing = true; rtw_reset_drv_sw23a(padapter);