Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666691pxb; Tue, 5 Apr 2022 17:59:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydCjPPP35j4j7VLRd5098PaPL7hpE3M+WhjgEC7LGl/k2Feka0DLg1nbRG/gfQsscxZ39L X-Received: by 2002:a17:907:9724:b0:6e0:f204:5c8c with SMTP id jg36-20020a170907972400b006e0f2045c8cmr6037382ejc.150.1649206661086; Tue, 05 Apr 2022 17:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206661; cv=none; d=google.com; s=arc-20160816; b=0jrQAfVNDdsN6sLWQ+cWeVfjW30VMEG6tvJ317JHqcO/ltoDCWWVSPgQRwCyhGKMZg 4xRgESh3/DUTCLYXn/LgY/oVxV4tCIiJcSgqdxUdWwlri2v+B+c1BUDFUpUfwf9fK0O6 5wpynGL3xyVLdDox2IlQhOIfYTdMI5qSyg8byhZ9069CnRoKMie3S8FW/3JmMV0Er291 zf5E3EHK2juxqZ8f9CaxVUfRdzkgdABzS+P6RurDmYB5kgIeyfRv5PjIyrjpaPgbxA49 LUMapQPv5ZKA90WuRbDdlJBbr8NoStOjNtnv0d0SDAKgy2Rx46HK8NtYDZnk/XbKLdri XhNg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wq5NQbDO1JVCb+sbYjb5vyGog62bLG1LdlGyhpQHLoo=; b=vMQYSZbmKqoxOQ7vdor0J6DpRrMLr83Uqcb5zSEMbXqQk49j4azgLl+B0H8kIZuUIQ eULMrq5Hxr9nC2Bg13GR+UvTusDhMw3JNMdPrPLfBADgAtlC2Y0baBTWqXbOIJ4bzo20 3q7GubK1vCEL5sIupJieyycKipWhJdqnsl7JyGAMnFAvVPlTcOXldfJtoRHHdB0YOur3 RsgvSbR13M/Kd5ABYBTNPrMVo9sQX1QRlGRaxi9f8q5xjCT76WSP54OaGWp88DedW0eE hBxJVh7jpdeUlAmPTtFnzmUnmxrgf0r+0USUotMb/HcWzWZHtFjVik7djJXb5DzlbkEF Xp+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="f//pAKcC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a1709066b0900b006df76385d90si10204697ejr.560.2022.04.05.17.57.14; Tue, 05 Apr 2022 17:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b="f//pAKcC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233883AbiDEI5x (ORCPT + 99 others); Tue, 5 Apr 2022 04:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236830AbiDEIRE (ORCPT ); Tue, 5 Apr 2022 04:17:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 485B4AF1CA; Tue, 5 Apr 2022 01:04:42 -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 ams.source.kernel.org (Postfix) with ESMTPS id C6737B81B18; Tue, 5 Apr 2022 08:04:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 167CAC385A1; Tue, 5 Apr 2022 08:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145880; bh=LyPBVx8iQgVte0mLMShFsahmudUkBbIGspJWwqMpRVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f//pAKcCklTFbIgPdxJ5YpZW47ONHFPjV70xiNrTjc1TJDl2HUOGqprrzkFDZLHUN GzmcSMqw4pzfvxfkHM2YTgDV3sfNut8Nemqb9O3olRQS6x5QVIgHBJt6VpWXVb7VSv FbiNCOBFiCt2F/t1kz1rZ1bsJKZkM8eTUpY/HxpQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Luca Coelho , Sasha Levin Subject: [PATCH 5.17 0564/1126] iwlwifi: mvm: Fix an error code in iwl_mvm_up() Date: Tue, 5 Apr 2022 09:21:51 +0200 Message-Id: <20220405070424.188296405@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 583d18336abdfb1b355270289ff8f6a2608ba905 ] Return -ENODEV instead of success on this error path. Fixes: dd36a507c806 ("iwlwifi: mvm: look for the first supported channel when add/remove phy ctxt") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210816183930.GA2068@kili Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index ae589b3b8c46..ee031a589714 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1658,8 +1658,10 @@ int iwl_mvm_up(struct iwl_mvm *mvm) while (!sband && i < NUM_NL80211_BANDS) sband = mvm->hw->wiphy->bands[i++]; - if (WARN_ON_ONCE(!sband)) + if (WARN_ON_ONCE(!sband)) { + ret = -ENODEV; goto error; + } chan = &sband->channels[0]; -- 2.34.1