From patchwork Fri May 11 14:57:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sushant Kumar Mishra X-Patchwork-Id: 10394551 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DD50260170 for ; Fri, 11 May 2018 14:54:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF23128EA2 for ; Fri, 11 May 2018 14:54:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3F7328EA6; Fri, 11 May 2018 14:54:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 591EB28EA2 for ; Fri, 11 May 2018 14:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753217AbeEKOy4 (ORCPT ); Fri, 11 May 2018 10:54:56 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:43376 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753150AbeEKOyz (ORCPT ); Fri, 11 May 2018 10:54:55 -0400 Received: by mail-pf0-f195.google.com with SMTP id j20-v6so2841866pff.10 for ; Fri, 11 May 2018 07:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xAV2eedeMho3CWo9ozOlwcAhtp9mONCIB8sxCZzybmw=; b=vNQIGDffy9yAQ0j8v2c6gYchYgLbsL+ZLwz5IwPaevj/IAUkmvkTvS1qZAzzHrR79n E6VPAehmkez+J+NBtX0yMTTCguhcwn4W0IXyyPV5nDRYL9z2YrTIrH8HvdbEwPIgHizN R8WGjOkqyUwdQMENxg4yLUUBwMRCa43DLVsDjAz/jOQ9aFpdqVpja069OqVWnsy1BmyH 0rnTlocHpJeE830t/ChLF0M36v3H+e60zjLnWIMatb8IQukqHaK+gelACtosndFXNqFN 5iWh+XQhToJidc3+CzKv0iAkX5Ub5eZ3H807q/GU7pMj99P16mE8kPjfqd8AcfK/wwYA JL8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xAV2eedeMho3CWo9ozOlwcAhtp9mONCIB8sxCZzybmw=; b=RgfnG1C5wPYP8NnQEXHKkQklQxShAaId+8/+xX543oUb3ZVwSvqlwCbD+lydGMw9yj UxigNoK0NLACpQ9hwVNpkHryPXdFegtjMAlDX6yFytB8Re6Ukado52RUNFHXLWMvziP5 JEn4SIX7t+t2KNktGcQAc74qIscRSvSTpL1L3NbjVHkfZGtwS13Lw2rNVQURRlCTJxC7 U3WQ73sIGUWmpYUJwZtCN3CE/T3hU/qTO3kE5lCQj8JHnlrIfj5iWNDDRCi6DHLGj2JU Mzq/+BzZRSU2mF6ty5MOxg/V33l8/Vo5z+5Xo82w/6kXjj6ixvaXx53uFnygR6dkgWZM Jo8A== X-Gm-Message-State: ALKqPwft4v63OR0EzcHaCaBYEv88rTKL5cVmD6sSEwbUROoTbJ4LTS+Z ycLr4XUGLue1GzzCN8vop5E= X-Google-Smtp-Source: AB8JxZq1SAeiIybogKdUu30zd3PhWiyx/oHWwvu4LancRy9N1lvNwRabs6KWLYBVrtPCbIc9NK48lw== X-Received: by 2002:a62:91b:: with SMTP id e27-v6mr5802999pfd.93.1526050495362; Fri, 11 May 2018 07:54:55 -0700 (PDT) Received: from cpu459.localdomain ([2401:4900:16b0:1f28:a827:5cff:fe87:3705]) by smtp.gmail.com with ESMTPSA id y83-v6sm1489559pfd.21.2018.05.11.07.54.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 07:54:54 -0700 (PDT) From: Sushant Kumar Mishra To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Siva Rebbagondla , Sushant Kumar Mishra , Sanjay Kumar Konduri Subject: [PATCH 1/3] rsi: Add null check for virtual interfaces in wowlan config Date: Fri, 11 May 2018 20:27:51 +0530 Message-Id: <1526050673-7026-2-git-send-email-sushant2k1513@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1526050673-7026-1-git-send-email-sushant2k1513@gmail.com> References: <1526050673-7026-1-git-send-email-sushant2k1513@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sanjay Kumar Konduri When the "poweroff" command is executed after wowlan enabled, we have observed a system crash. In the system "poweroff" sequence, network-manager is sent to inactive state by cleaning up the network interfaces, using rsi_mac80211_remove_interface() and when driver tries to access those network interfaces in rsi_wowlan_config() which was invoked by SDIO shutdown, results in a crash. Added a NULL check before accessing the network interfaces in rsi_wowlan_config(). Signed-off-by: Sanjay Kumar Konduri Signed-off-by: Siva Rebbagondla Signed-off-by: Sushant Kumar Mishra --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 80e7f4f..743706e 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -1804,10 +1804,15 @@ int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan) struct rsi_common *common = adapter->priv; u16 triggers = 0; u16 rx_filter_word = 0; - struct ieee80211_bss_conf *bss = &adapter->vifs[0]->bss_conf; + struct ieee80211_bss_conf *bss = NULL; rsi_dbg(INFO_ZONE, "Config WoWLAN to device\n"); + if (!adapter->vifs[0]) + return -EINVAL; + + bss = &adapter->vifs[0]->bss_conf; + if (WARN_ON(!wowlan)) { rsi_dbg(ERR_ZONE, "WoW triggers not enabled\n"); return -EINVAL;