Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp876602rwb; Mon, 26 Sep 2022 07:02:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4P0DGt0wzdpyCyr6P988X3y5tMCPScsPxqeRNFGLGtlMBfFHROYhfQwgGIhorJoRP39KW+ X-Received: by 2002:a05:6a00:cc6:b0:541:3fff:35a5 with SMTP id b6-20020a056a000cc600b005413fff35a5mr23858746pfv.67.1664200945301; Mon, 26 Sep 2022 07:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664200945; cv=none; d=google.com; s=arc-20160816; b=N3IffNz7kIpM9C9K/dYt27Gcm2oCb1zDZutwkKKCzOlLGlwtO6aRLbd8fuNBhc3r9B 9XKXASSWpMzvduq3G1lfsBX+D/reKz/TgIgN1GnAlvdCwwYsZ81pGxDaWXI8MWw7Q6Gd TEXykIWs3f8/MmNthjg5U7aIp/RjACAvLJKw+FhTaL+OEZvpsbDYXlXy0WtQgSTuFl7i dW0wQ+mj6aAmIixm2TiO4vDaL8rEFfxengRGbPHF9H6ghrS/6SGlfY4IZzEzvTSez2VT 6O3xrO/msAZwp1HEACVMuCQrxixOehvKg171kYqdLCflmBYc21gYmS5uynjUhzcrAhOC LsZQ== 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=dGNIjnbLVYE3T3g1w3n/Bga0LtTiluaV2jFICSzimIc=; b=f7oGCnkQvBKas2e01pe19+00574uzRtV9srrVM5czQYMcR3e4qvEVeEQUrC5ibtzgL r6UUFWHGqp7rR02CPOVU6MeVEO3zt8Aq8GCcXSrh86V7bxGInBoV2PseyvzmAYuoQm1u 4TOV81BmSTtWNX1WzF6sm4FDF+GDpjl8GX1G6W5icNMpRt2p4/q3kiQGZnF6EDCB6LIf dPYLDJo/9E7BSECGrJrSsY8stnXHWfHAdcS5sigHmbyYePQ1Vdxhx+ZsnbsMnM9z9ndB vJFgo5DVFIwks9oN/u3st9C41gWcFrXkCARH2q9PgK5VFcVDSJUsDjfd5UtVyfI1LOTR wK9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fG1wA3Hh; 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 b26-20020a63715a000000b0042c3a5b699asi22909707pgn.783.2022.09.26.07.02.11; Mon, 26 Sep 2022 07:02:25 -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=fG1wA3Hh; 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 S239370AbiIZMHL (ORCPT + 99 others); Mon, 26 Sep 2022 08:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239638AbiIZMEw (ORCPT ); Mon, 26 Sep 2022 08:04:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE4017590; Mon, 26 Sep 2022 03:54:47 -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 7B023B80835; Mon, 26 Sep 2022 10:48:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB42BC433D6; Mon, 26 Sep 2022 10:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189306; bh=09tTN7yUH5tIKpaq/OFSWMXTbbcnSxc+91PHZDmxjQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fG1wA3HhACGToDa/AJw6gNhk4YG2v31DnKDTsONE5eHVcYBNi/+bHBEffsHJwNWmZ BrnI/h4p+lng6x/Md41n2zmA0r7a3mUJw19/5e97mTECl1yYhLzNJbHOTKGzsugUid 19CAovVXS6P2bS219q7/exAwEyP6pNL0WekDknwo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Dongliang Mu , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.19 143/207] gpio: tqmx86: fix uninitialized variable girq Date: Mon, 26 Sep 2022 12:12:12 +0200 Message-Id: <20220926100812.906881247@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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 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: Dongliang Mu [ Upstream commit 21a9acc162457402c74c5c1e16471fda6eb090c0 ] The commit 924610607f19 ("gpio: tpmx86: Move PM device over to irq domain") adds a dereference of girq that may be uninitialized. Fix this by moving irq_domain_set_pm_device into if true branch as suggested by Marc Zyngier. Fixes: 924610607f19 ("gpio: tpmx86: Move PM device over to irq domain") Suggested-by: Marc Zyngier Signed-off-by: Dongliang Mu Acked-by: Marc Zyngier Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-tqmx86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c index fa4bc7481f9a..e739dcea61b2 100644 --- a/drivers/gpio/gpio-tqmx86.c +++ b/drivers/gpio/gpio-tqmx86.c @@ -307,6 +307,8 @@ static int tqmx86_gpio_probe(struct platform_device *pdev) girq->default_type = IRQ_TYPE_NONE; girq->handler = handle_simple_irq; girq->init_valid_mask = tqmx86_init_irq_valid_mask; + + irq_domain_set_pm_device(girq->domain, dev); } ret = devm_gpiochip_add_data(dev, chip, gpio); @@ -315,8 +317,6 @@ static int tqmx86_gpio_probe(struct platform_device *pdev) goto out_pm_dis; } - irq_domain_set_pm_device(girq->domain, dev); - dev_info(dev, "GPIO functionality initialized with %d pins\n", chip->ngpio); -- 2.35.1