Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp902388rwd; Thu, 8 Jun 2023 09:12:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NqlTsMpgXJh/dap3l0hFGlhvFCtNtH6aSHpt26A+PNAr0YlruxijfdQir8mzkiVEJ3+AH X-Received: by 2002:a92:dc48:0:b0:33e:80a0:c33a with SMTP id x8-20020a92dc48000000b0033e80a0c33amr1534527ilq.16.1686240720293; Thu, 08 Jun 2023 09:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686240720; cv=none; d=google.com; s=arc-20160816; b=u2BYfE+EdWarAzw7WXqA2c4SBSkPolNjp+mTJKR+axrbvJ2LE/NLsiNaCp15swXavP yfkZfw5NxShxAefdukIStgGC17PVJNzEQvQ2Z28rpbIO2QxNS6pkW7CSbdSZ8UQ2odII unyykL+O4RUmMW0nqajuECwlV0CgltOrdwmKqRt9aQRkBPJ/ST2hTZRq9nxzMqRgtl2E XiScY8lVgRIyGW2eaagdDXh8+5I87o9x8kQ6z0rb3r4JOSxGcM5W61DU+gQLIKG0gUfZ X0UKHMy1p59mBF3B13MstJejWE7v1k3J4Ccb7yTO0FnztQcPeiBqhpaliEM5Adnawc8Q NF+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=3YLCd1VPmVh6LnBWs69LYR8OwkQNa82rbb68BRmcJuY=; b=cc2xEU2Z2hXMB0sq7YN/buya7aNuoSPYav77Ti5dUSjozVjYPzyBbaTlQVaMFFXHt3 jcGpqpLg4MqvMgMi/NYnorjEJ70MX5WCoWHZTTei9eXIkZ2eRyGQhZoSGpOGPXH2eT4y 1TdszNvgFktzhYeD+pfZbiVGHngeOP2TmxpsRl82HclhJuFIIPuKwaQKSBAzZY8koFfp AwY3HGXfxRJQJywRIncRWWtOeDdrv3XqyM7fO2v0Cc4S1LDdnjmsIjwhpr8cDkiwLp33 h8SWCoO+sr6eEt3H8PNmpu0OLeIQVc1tRRNkuKl/UzH8sUNXwQpOqsKKGjt5et1G/SS1 fV3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HmC8d/8c"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q37-20020a17090a17a800b00258c1cef517si2940412pja.135.2023.06.08.09.11.51; Thu, 08 Jun 2023 09:12:00 -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=@kernel.org header.s=k20201202 header.b="HmC8d/8c"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjFHQCV (ORCPT + 61 others); Thu, 8 Jun 2023 12:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjFHQCI (ORCPT ); Thu, 8 Jun 2023 12:02:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6A2B359A for ; Thu, 8 Jun 2023 09:01:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B27D64EC7 for ; Thu, 8 Jun 2023 16:01:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00FC0C433EF; Thu, 8 Jun 2023 16:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686240111; bh=uxVKn8B7UnQ7DreeWBr1pGGtJNVRbe4Xc8LONzaoKIo=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=HmC8d/8cWuDnixAGJOBiwaVNqpPdxrnj2y90EpYHdD9J3T1n9znwL8njhjbYfG5K6 P/b/3utJHAuGyP363I8W6hymnA6B5oypOD4H29DCTtAvrExZcvH1NUhfIpXgqRkTkQ s5PVA8Hj33SfKBm53uffoR3sp0SqRBNXQwIUO9l7VzWaoFdSwuvOOUo9hTko1GYP9/ LoB5/vdyFN9l0L7xXluzMYAL0UUro9wSSeg9LEhaPMrZ0Sk6YaG6hcmeR8UcKfSvn8 TUt/iifOyBpgGx/HZtLMXJPsaZTpnHUjAHeKhcPMyKxaDB0eBBVzvUzSWQwQ/9Vd7/ 2e/wVIC3KKqXw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled From: Kalle Valo In-Reply-To: <20230527222833.273741-1-marex@denx.de> References: <20230527222833.273741-1-marex@denx.de> To: Marek Vasut Cc: linux-wireless@vger.kernel.org, Marek Vasut , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jilin Yuan , Paolo Abeni , netdev@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <168624010800.5828.9610241801394227388.kvalo@kernel.org> Date: Thu, 8 Jun 2023 16:01:49 +0000 (UTC) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Marek Vasut wrote: > In case WoWlan was never configured during the operation of the system, > the hw->wiphy->wowlan_config will be NULL. rsi_config_wowlan() checks > whether wowlan_config is non-NULL and if it is not, then WARNs about it. > The warning is valid, as during normal operation the rsi_config_wowlan() > should only ever be called with non-NULL wowlan_config. In shutdown this > rsi_config_wowlan() should only ever be called if WoWlan was configured > before by the user. > > Add checks for non-NULL wowlan_config into the shutdown hook. While at it, > check whether the wiphy is also non-NULL before accessing wowlan_config . > Drop the single-use wowlan_config variable, just inline it into function > call. > > Fixes: 16bbc3eb8372 ("rsi: fix null pointer dereference during rsi_shutdown()") > Signed-off-by: Marek Vasut > Reviewed-by: Simon Horman Patch applied to wireless-next.git, thanks. b241e260820b wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled -- https://patchwork.kernel.org/project/linux-wireless/patch/20230527222833.273741-1-marex@denx.de/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches