From: Sasha Levin <sashal@kernel.org>
To: linux-aspeed@lists.ozlabs.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 [thread overview]
Message-ID: <20220714042541.282175-2-sashal@kernel.org> (raw)
In-Reply-To: <20220714042541.282175-1-sashal@kernel.org>
From: Haowen Bai <baihaowen@meizu.com>
[ 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 <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650508019-22554-1-git-send-email-baihaowen at meizu.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Haowen Bai <baihaowen@meizu.com>,
Linus Walleij <linus.walleij@linaro.org>,
Sasha Levin <sashal@kernel.org>,
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 [thread overview]
Message-ID: <20220714042541.282175-2-sashal@kernel.org> (raw)
In-Reply-To: <20220714042541.282175-1-sashal@kernel.org>
From: Haowen Bai <baihaowen@meizu.com>
[ 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 <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650508019-22554-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>, Haowen Bai <baihaowen@meizu.com>,
linux-aspeed@lists.ozlabs.org, andrew@aj.id.au,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, joel@jms.id.au,
openbmc@lists.ozlabs.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 [thread overview]
Message-ID: <20220714042541.282175-2-sashal@kernel.org> (raw)
In-Reply-To: <20220714042541.282175-1-sashal@kernel.org>
From: Haowen Bai <baihaowen@meizu.com>
[ 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 <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650508019-22554-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Haowen Bai <baihaowen@meizu.com>,
Linus Walleij <linus.walleij@linaro.org>,
Sasha Levin <sashal@kernel.org>,
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 [thread overview]
Message-ID: <20220714042541.282175-2-sashal@kernel.org> (raw)
In-Reply-To: <20220714042541.282175-1-sashal@kernel.org>
From: Haowen Bai <baihaowen@meizu.com>
[ 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 <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650508019-22554-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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
next prev parent reply other threads:[~2022-07-14 4:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 4:25 [PATCH AUTOSEL 5.10 01/15] ASoC: ops: Fix off by one in range control validation Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` Sasha Levin [this message]
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 02/15] pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 03/15] ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 04/15] ASoC: wm5110: Fix DRE control Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 05/15] ASoC: dapm: Initialise kcontrol data for mux/demux controls Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 06/15] ASoC: cs47l15: Fix event generation for low power mux control Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 07/15] ASoC: madera: Fix event generation for OUT1 demux Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 08/15] ASoC: madera: Fix event generation for rate controls Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 09/15] irqchip: or1k-pic: Undefine mask_ack for level triggered hardware Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 10/15] x86: Clear .brk area at early boot Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 11/15] soc: ixp4xx/npe: Fix unused match warning Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 12/15] ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 13/15] Revert "can: xilinx_can: Limit CANFD brp to 2" Sasha Levin
2022-07-14 4:25 ` Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 14/15] nvme-pci: phison e16 has bogus namespace ids Sasha Levin
2022-07-14 4:25 ` [PATCH AUTOSEL 5.10 15/15] signal handling: don't use BUG_ON() for debugging Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220714042541.282175-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-aspeed@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.