Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2281581iof; Wed, 8 Jun 2022 01:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdC0rgykfgJO6R35VS5mH5xumTpfZhadPCrU4CGpr7th973wlJ+PHusq0daR99TvZYE9ct X-Received: by 2002:a17:90b:4f41:b0:1e4:9081:6aa with SMTP id pj1-20020a17090b4f4100b001e4908106aamr35972544pjb.183.1654676361630; Wed, 08 Jun 2022 01:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654676361; cv=none; d=google.com; s=arc-20160816; b=IATBbJ4INAIwE5PuSPdnRIZaW9v13DHjbLGyjQPGmZmpxclpg7/QQAo74LgzudW89K M/sWsBuyXaFrb+zWY9g/NhXPB4435dLCBkdZ0L/wgLGLFD2g1dstic7ys49HaFLhfKU4 pxFGLxYD2GESbGwggRlnBsuRQI9zLmjHo/qTCD2v97XA1HES9+xXjXSndG/N6RQkFa1Q ZJsLJ7+VE7Yp5dK84uZrA2eDhBaWaHNFQwhETNvmqDVs2KJQNwLM0xv3kIR60Po/SnNE iofUQovOWuMui/7rjrWED2n75XFCh7UpTzPDG3HvQrSFrqpIm9ZEyTvwI+FZX7oAp8Xe z65w== 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=/dI7WrAUPvS2RSThQnBMCctRf3s6TG7IxP6FMdG+aMg=; b=HYbJN1UbWIa8xq49Hg0Pqa9dWkYQIiK+QNkgrD9Lk5E/w3FMY5xgk1t0yi28HVsYS3 Mm3KnEHQLfEK0cv7d3yzNde/Zc6iGu5cf8Md6cFoiR2PPgWb+PkxBGY0293/rkdpsYK2 eeVcCz1ZwJd8keglCS/O9e1Qid//TNvrryosCfZdAcNzz+gryPHixVfqoChha8coG+Pc +MtX1C0PHXCBsnKWzQ5YqwEG64CfBzwEjQ4bZ7+KsRPjW74WEUDvy7sQkS0ai/8S3Dmx QDnnE5dfGq23jra7oaWvjp8jobhWmw0ODwcNJZzJGPSnvYimMfx1VmjpC+W5oG+ayuZs Sfsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1vHMLFaM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x128-20020a633186000000b003f5ccb1a239si25718408pgx.113.2022.06.08.01.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1vHMLFaM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 80E8B13900B; Wed, 8 Jun 2022 00:49:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385949AbiFGWrZ (ORCPT + 99 others); Tue, 7 Jun 2022 18:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380851AbiFGViQ (ORCPT ); Tue, 7 Jun 2022 17:38:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCEDE1C13A; Tue, 7 Jun 2022 12:05:26 -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 78435617EE; Tue, 7 Jun 2022 19:05:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 849F4C385A2; Tue, 7 Jun 2022 19:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628725; bh=Whr85xBJzYK0FWJhwzET+EpOWlc68uR+NHnFIy1/Ln8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1vHMLFaMAKNoMUmufzO+LZ0KJhvjvNMsg+HtCBwU+a1ObRr+ZpQrAvpv62QMgeW+8 lUuREANm2icpYl66d3EssrGGrEdzZwe3bK44iAbXx1wWVLZ8Y672UnFvmHnvBFoJhe gqnUrplXln30JVICLjrxSK9NBQlY6xDwqczDslss= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 5.18 433/879] mt76: mt7915: fix possible uninitialized pointer dereference in mt7986_wmac_gpio_setup Date: Tue, 7 Jun 2022 18:59:11 +0200 Message-Id: <20220607165015.438710968@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Lorenzo Bianconi [ Upstream commit 9bd6823f5a64b6465708b244eecc9b7dd4b01bfc ] Add default case for type switch in mt7986_wmac_gpio_setup routine in order to avoid a possible uninitialized pointer dereference. Fixes: 99ad32a4ca3a2 ("mt76: mt7915: add support for MT7986") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c index 3028c02cb840..be448d471b03 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c @@ -210,6 +210,8 @@ static int mt7986_wmac_gpio_setup(struct mt7915_dev *dev) if (IS_ERR_OR_NULL(state)) return -EINVAL; break; + default: + return -EINVAL; } ret = pinctrl_select_state(pinctrl, state); -- 2.35.1