clk: bcm2835: fix check of error code returned by devm_ioremap_resource()
Subsystems (3)
PATCH 1/1 clk: bcm2835: fix check of error code returned by devm_ioremap_resource()
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.
--- drivers/clk/bcm/clk-bcm2835-aux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/bcm/clk-bcm2835-aux.c +2 -2
@@ -38,8 +38,8 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg =devm_ioremap_resource (dev, res); -if (!reg) -return -ENODEV ; +if (IS_ERR (reg)) +return PTR_ERR (reg); onecell =devm_kmalloc (dev,sizeof (*onecell),GFP_KERNEL );if (!onecell)
Signature · 1 line
2.1.4
PATCH 1/1 clk: bcm2835: fix check of error code returned by devm_ioremap_resource()
Quoted 8 lines · Vladimir Zapolskiy
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 returnsERR_PTR()and never returns NULL, which makes useless a following check for NULL.Signed-off-by Vladimir Zapolskiy <[email protected]>Fixes 5e63dcc74b30 ("clk: bcm2835: Add a driver for the auxiliary peripheral clock gates")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160307/8e3b3375/attachment.sig>
Stephen Boyd
AppliedPATCH 1/1 clk: bcm2835: fix check of error code returned by devm_ioremap_resource()
In reply to Vladimir ZapolskiyQuoted 9 lines · Vladimir Zapolskiy
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 returnsERR_PTR()and never returns NULL, which makes useless a following check for NULL.Signed-off-by Vladimir Zapolskiy <[email protected]>Fixes 5e63dcc74b30 ("clk: bcm2835: Add a driver for the auxiliary peripheral clock gates")---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project