* Patch "pwm: brcmstb: Fix check of devm_ioremap_resource() return code" has been added to the 4.5-stable tree
@ 2016-05-01 23:20 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-05-01 23:20 UTC (permalink / raw)
To: vz, f.fainelli, gregkh, thierry.reding; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
pwm: brcmstb: Fix check of devm_ioremap_resource() return code
to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
pwm-brcmstb-fix-check-of-devm_ioremap_resource-return-code.patch
and it can be found in the queue-4.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From c5857e3f94ab2719dfac649a146cb5dd6f21fcf3 Mon Sep 17 00:00:00 2001
From: Vladimir Zapolskiy <vz@mleia.com>
Date: Sun, 6 Mar 2016 03:21:46 +0200
Subject: pwm: brcmstb: Fix check of devm_ioremap_resource() return code
From: Vladimir Zapolskiy <vz@mleia.com>
commit c5857e3f94ab2719dfac649a146cb5dd6f21fcf3 upstream.
The change fixes potential oops while accessing iomem on invalid address
if devm_ioremap_resource() fails due to some reason.
The devm_ioremap_resource() function returns ERR_PTR() and never returns
NULL, which makes useless a following check for NULL.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Fixes: 3a9f5957020f ("pwm: Add Broadcom BCM7038 PWM controller support")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pwm/pwm-brcmstb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/pwm/pwm-brcmstb.c
+++ b/drivers/pwm/pwm-brcmstb.c
@@ -274,8 +274,8 @@ static int brcmstb_pwm_probe(struct plat
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
p->base = devm_ioremap_resource(&pdev->dev, res);
- if (!p->base) {
- ret = -ENOMEM;
+ if (IS_ERR(p->base)) {
+ ret = PTR_ERR(p->base);
goto out_clk;
}
Patches currently in stable-queue which might be from vz@mleia.com are
queue-4.5/pwm-brcmstb-fix-check-of-devm_ioremap_resource-return-code.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-01 23:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-01 23:20 Patch "pwm: brcmstb: Fix check of devm_ioremap_resource() return code" has been added to the 4.5-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).