Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1001239rwd; Wed, 7 Jun 2023 09:34:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YYexJn/InQUqCTV6crG/jbXwCqTIUFDKyWyC//OTXdyNzjLgJzeen+bHld2qYNb37rdA7 X-Received: by 2002:a05:6a00:1302:b0:64c:9b56:6215 with SMTP id j2-20020a056a00130200b0064c9b566215mr2146146pfu.25.1686155673953; Wed, 07 Jun 2023 09:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686155673; cv=none; d=google.com; s=arc-20160816; b=ikNo2z1BcuQmmEcTpMnAS0A5RrE+5PfrFmDf58yfNEysw8Z0+zlowGM78CPbrSFGFO tJHK/EAeuoUfaGsIUGdynJkYMjQt1MjiW46T1AfIN0VxnagGScBKoV5vkhWx4tZb1gmv q0Adza21CLdOgJq77eCOo0v7bAeEgPfwtB1ID2gjVJ+KpyMkLQthVtb6F/i02uMAYV5E OWIFC7FJXrY7TyHYJvmSnsdUX6gkHQJrFs0e/PJZqqUuWartJZcUDlG3YMLGduJIPKsN N+GObjqm4uoFECXxeSmNNHsYf50pwKU09m+L1Dc8V/lRWyzWCSqCdMmOEp9ySLwUUHgk qmGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FKy9jnvA+7Y7SWCGMGxUppexL6ZNvSWKfqcugwV1E6E=; b=Hbx8yZ4OcQwmp+rtgHGZ4o6GytuKj9VtLk2BauRtQPN1Er5sueUJcEkEb6Ms/91yop uFVtUgyFa+nwI72ztRPsAXrEHWQT4NxapwKQpyMp81fMXAfJdnwhyenl4YDP3GZbBmxT ZeefKCr3FIR7YfWf7SSET6MSnv0z/Lhc+DdrfSmhuBLgQHol/QyQ/R3zN8Xtgp37T5FU 0eNmC2uGBi3hnfnNt3jPpTZqQa/gFWRTh2rBFjGG5nCuSG1tC6HmQmyxWTmt+vSj9F7l 5YkLhzK5qDhZn+u4bO4tEyDZUxFj2vP1MlMxdYwQE8U51uHDD0ySmsMsmKJahcjRI4+2 8hAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=EjkbO0+b; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020aa79988000000b0063bba133a6esi8862758pfh.4.2023.06.07.09.34.25; Wed, 07 Jun 2023 09:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=EjkbO0+b; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233336AbjFGQQh (ORCPT + 61 others); Wed, 7 Jun 2023 12:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238363AbjFGQQf (ORCPT ); Wed, 7 Jun 2023 12:16:35 -0400 Received: from forward100b.mail.yandex.net (forward100b.mail.yandex.net [IPv6:2a02:6b8:c02:900:1:45:d181:d100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3F86199D for ; Wed, 7 Jun 2023 09:16:33 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:6e01:0:640:627f:0]) by forward100b.mail.yandex.net (Yandex) with ESMTP id C7A466004A; Wed, 7 Jun 2023 19:16:31 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id KGX7fTADXSw0-Z7GhDIYG; Wed, 07 Jun 2023 19:16:31 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1686154591; bh=FKy9jnvA+7Y7SWCGMGxUppexL6ZNvSWKfqcugwV1E6E=; h=Message-Id:Date:Cc:Subject:To:From; b=EjkbO0+btHmbhSYVMA1decB98dITHjccXiYIUAh9h/+3ontgIQ7s4/trnCtOTQsEM JQ2luVvdMEVSnjn67Je5C5kNZQY/6+kJvE9+i11ql6R6IlItWDrimOnLZ3z02PjzlQ HlWpRz9p8HDDcQZppfs9cnc16uAxhpTH1QxiypJ0= Authentication-Results: mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Franky Lin Cc: brcm80211-dev-list.pdl@broadcom.com, linux-wireless@vger.kernel.org, Kalle Valo , lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH 1/3] wifi: brcmfmac: handle possible WOWL configuration error Date: Wed, 7 Jun 2023 19:16:08 +0300 Message-Id: <20230607161611.85106-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Convert 'brcmf_configure_wowl()' to return 's32' which may be an error raised by 'brcmf_fil_iovar_data_set()', pass the value to 'brcmf_cfg80211_suspend()' and adjust related code. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index de8a2e27f49c..5a0b32322b4f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -4175,12 +4175,13 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy) return 0; } -static void brcmf_configure_wowl(struct brcmf_cfg80211_info *cfg, - struct brcmf_if *ifp, - struct cfg80211_wowlan *wowl) +static s32 brcmf_configure_wowl(struct brcmf_cfg80211_info *cfg, + struct brcmf_if *ifp, + struct cfg80211_wowlan *wowl) { u32 wowl_config; struct brcmf_wowl_wakeind_le wowl_wakeind; + s32 err = 0; u32 i; brcmf_dbg(TRACE, "Suspend, wowl config.\n"); @@ -4223,12 +4224,15 @@ static void brcmf_configure_wowl(struct brcmf_cfg80211_info *cfg, wowl_config |= BRCMF_WOWL_UNASSOC; memcpy(&wowl_wakeind, "clear", 6); - brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", &wowl_wakeind, - sizeof(wowl_wakeind)); - brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config); - brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1); - brcmf_bus_wowl_config(cfg->pub->bus_if, true); - cfg->wowl.active = true; + err = brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", &wowl_wakeind, + sizeof(wowl_wakeind)); + if (err == 0) { + brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config); + brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1); + brcmf_bus_wowl_config(cfg->pub->bus_if, true); + cfg->wowl.active = true; + } + return err; } static int brcmf_keepalive_start(struct brcmf_if *ifp, unsigned int interval) @@ -4256,6 +4260,7 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct net_device *ndev = cfg_to_ndev(cfg); struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_cfg80211_vif *vif; + s32 err = 0; brcmf_dbg(TRACE, "Enter\n"); @@ -4293,18 +4298,19 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, brcmf_set_mpc(ifp, 1); } else { - /* Configure WOWL paramaters */ - brcmf_configure_wowl(cfg, ifp, wowl); + /* Configure WOWL parameters */ + err = brcmf_configure_wowl(cfg, ifp, wowl); /* Prevent disassociation due to inactivity with keep-alive */ - brcmf_keepalive_start(ifp, 30); + if (err == 0) + brcmf_keepalive_start(ifp, 30); } exit: brcmf_dbg(TRACE, "Exit\n"); /* clear any scanning activity */ cfg->scan_status = 0; - return 0; + return err; } static s32 -- 2.40.1