From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 676A9CCA47B for ; Thu, 14 Jul 2022 05:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+FisffgRBShv/ZLCquFSJkT4EEzzFDppt63qv4Ot+sY=; b=1s8cgGP1s+8Pmu j4pCtCst41mjFXB2iubsOEncXxcPwFjgZYG6S2mbMtOSw2p6moBbfyevoJjjaUnnzSCQIGK7KllX5 H4djVB+PFTWk4muwPUtbM9SrAI8bWn+GbWbg3efjmndYgoZu1UWrcStTn7OWmxMDJy4BaCC7ZFM7a 07UB5CsNVySsqqL6M4WqIYNowqGJS64TRdpGB3aEj05GMUlZL/38bmn1BKZfNGbs9QHRlU6WonjZz 9Pwa91Ks1dMCd1KDW3QsFD868w/YgpCUG30hpBApddaF0qQ6AcF7J2ViQbNoluaQp5kkCR6CDF+d/ eSg/qxTbaOIJdm/hdwKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBqwl-00As7v-B6; Thu, 14 Jul 2022 04:59:31 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBqwY-00Arxx-Ou for linux-arm-kernel@bombadil.infradead.org; Thu, 14 Jul 2022 04:59:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=3Lj0F//oh0u1d7GR68XhiAAhhtz/IvbcvXSwF6vQ044=; b=XebFHx9rS77vScTuOHS3UqcAov 0apHPyVyj8rThkhw8DmRIHT9lJ70C/w6LdLxkDP5Uwmb6aMKu0rgYya2RhGtiSRlIlKC+7mX2q6ne HObNyqg2U3Em1KD/4ixRwliLA87e9qa4fwDwRrG/T3kp00XxSyPSAjGn5VFE0kSCS2RNfr1SlAtNr aWb1UayS8F4wqMSWX92eg+H5f0hfE3WG0GTQI133QnVNp8cpygqzxyxAtisFPzjeOfSCczScJNaQL xuVBAAKF/OyICtmvWdQ3cuzNIGTIIcw4aPizJVxDNneRDLnEKDBh9HDLaUoC7i5fqenuEUB+VyZ42 Gbj/oakA==; Received: from dfw.source.kernel.org ([139.178.84.217]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBqQ7-003kHe-4T for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 04:25:50 +0000 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 EAFAA61EC3; Thu, 14 Jul 2022 04:25:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A1F6C385A2; Thu, 14 Jul 2022 04:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772745; bh=i8j8lN8pZ+HBk9c+r3zEGf+7yulVsOuUqHCIcEWp5X8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P8boJ2oWMc1eMcBkSFOxAcRTLiIaMgqNWYCVfjv4Me5M1QZPrZJpJHrdqrfRlezdv 679LT6yyP5feH7yBSniPe0rkmLzlZm003LnbLyFhmLlXpWE+Op6LovE9uX1idXG11S V8GxVz4OolZU+zbPg9NDlzAHGXvnY+hEh2sKhBCo7y/QW3PbsynXrl2t1ExoTdpMI9 +Z2G0dS3mUBGzcu5FF59nt18Ejd6GZqTORns78p9uh56lJsRh3395KXr5ip3IwfEqb XumVlbAM3C6Zrp/LwWnYsTerMI+tM4d2Ic2TqEDsBtngYeiIySv2wQHedKjnbDrCnX H2i0PqShSJOxQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Haowen Bai , Linus Walleij , Sasha Levin , andrew@aj.id.au, joel@jms.id.au, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 02/15] pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() Date: Thu, 14 Jul 2022 00:25:27 -0400 Message-Id: <20220714042541.282175-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042541.282175-1-sashal@kernel.org> References: <20220714042541.282175-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_052547_681194_9F18E679 X-CRM114-Status: GOOD ( 13.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Haowen Bai [ Upstream commit 84a85d3fef2e75b1fe9fc2af6f5267122555a1ed ] pdesc could be null but still dereference pdesc->name and it will lead to a null pointer access. So we move a null check before dereference. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650508019-22554-1-git-send-email-baihaowen@meizu.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/aspeed/pinctrl-aspeed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c index 9c65d560d48f..e792318c3894 100644 --- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c @@ -235,11 +235,11 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function, const struct aspeed_sig_expr **funcs; const struct aspeed_sig_expr ***prios; - pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name); - if (!pdesc) return -EINVAL; + pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name); + prios = pdesc->prios; if (!prios) -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel