* [PATCH] drivers/serial: Do not leave sysfs group in case of error in aspeed_vuart_probe()
@ 2017-07-28 18:54 Alexey Khoroshilov
2017-07-31 9:23 ` Joel Stanley
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2017-07-28 18:54 UTC (permalink / raw)
To: Jeremy Kerr, Joel Stanley
Cc: Alexey Khoroshilov, Rob Herring, Benjamin Herrenschmidt,
Andy Shevchenko, Greg Kroah-Hartman, linux-serial, linux-kernel,
ldv-project
There are several error handling paths in aspeed_vuart_probe(),
where sysfs group is left unremoved. The patch fixes them.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/tty/serial/8250/8250_aspeed_vuart.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index 822be4906763..33a801353114 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -223,12 +223,13 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
if (IS_ERR(vuart->clk)) {
dev_warn(&pdev->dev,
"clk or clock-frequency not defined\n");
- return PTR_ERR(vuart->clk);
+ rc = PTR_ERR(vuart->clk);
+ goto err_sysfs_remove;
}
rc = clk_prepare_enable(vuart->clk);
if (rc < 0)
- return rc;
+ goto err_sysfs_remove;
clk = clk_get_rate(vuart->clk);
}
@@ -286,6 +287,8 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
err_clk_disable:
clk_disable_unprepare(vuart->clk);
irq_dispose_mapping(port.port.irq);
+err_sysfs_remove:
+ sysfs_remove_group(&vuart->dev->kobj, &aspeed_vuart_attr_group);
return rc;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/serial: Do not leave sysfs group in case of error in aspeed_vuart_probe()
2017-07-28 18:54 [PATCH] drivers/serial: Do not leave sysfs group in case of error in aspeed_vuart_probe() Alexey Khoroshilov
@ 2017-07-31 9:23 ` Joel Stanley
0 siblings, 0 replies; 2+ messages in thread
From: Joel Stanley @ 2017-07-31 9:23 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Jeremy Kerr, Rob Herring, Benjamin Herrenschmidt, Andy Shevchenko,
Greg Kroah-Hartman, linux-serial, Linux Kernel Mailing List,
ldv-project
Hello Alexey,
On Sat, Jul 29, 2017 at 4:24 AM, Alexey Khoroshilov
<khoroshilov@ispras.ru> wrote:
> There are several error handling paths in aspeed_vuart_probe(),
> where sysfs group is left unremoved. The patch fixes them.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Thanks for the patch.
Acked-by: Joel Stanley <joel@jms.id.au>
Cheers,
Joel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-31 9:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28 18:54 [PATCH] drivers/serial: Do not leave sysfs group in case of error in aspeed_vuart_probe() Alexey Khoroshilov
2017-07-31 9:23 ` Joel Stanley
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).