2020-10-12 13:36:07

by Jing Xiangfeng

[permalink] [raw]
Subject: [PATCH] staging: fieldbus: anybuss: jump to correct label in an error path

In current code, controller_probe() misses to call ida_simple_remove()
in an error path. Jump to correct label to fix it.

Fixes: 17614978ed34 ("staging: fieldbus: anybus-s: support the Arcx anybus controller")
Signed-off-by: Jing Xiangfeng <[email protected]>
---
drivers/staging/fieldbus/anybuss/arcx-anybus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
index 5b8d0bae9ff3..b5fded15e8a6 100644
--- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
+++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
@@ -293,7 +293,7 @@ static int controller_probe(struct platform_device *pdev)
regulator = devm_regulator_register(dev, &can_power_desc, &config);
if (IS_ERR(regulator)) {
err = PTR_ERR(regulator);
- goto out_reset;
+ goto out_ida;
}
/* make controller info visible to userspace */
cd->class_dev = kzalloc(sizeof(*cd->class_dev), GFP_KERNEL);
--
2.17.1


2020-10-23 16:03:44

by Sven Van Asbroeck

[permalink] [raw]
Subject: Re: [PATCH] staging: fieldbus: anybuss: jump to correct label in an error path

Hi Jing, thank you for your patch.

Reviewed-by: Sven Van Asbroeck <[email protected]>

On Mon, Oct 12, 2020 at 9:17 AM Jing Xiangfeng <[email protected]> wrote:
>
> In current code, controller_probe() misses to call ida_simple_remove()
> in an error path. Jump to correct label to fix it.
>
> Fixes: 17614978ed34 ("staging: fieldbus: anybus-s: support the Arcx anybus controller")
> Signed-off-by: Jing Xiangfeng <[email protected]>
> ---
> drivers/staging/fieldbus/anybuss/arcx-anybus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> index 5b8d0bae9ff3..b5fded15e8a6 100644
> --- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> +++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
> @@ -293,7 +293,7 @@ static int controller_probe(struct platform_device *pdev)
> regulator = devm_regulator_register(dev, &can_power_desc, &config);
> if (IS_ERR(regulator)) {
> err = PTR_ERR(regulator);
> - goto out_reset;
> + goto out_ida;
> }
> /* make controller info visible to userspace */
> cd->class_dev = kzalloc(sizeof(*cd->class_dev), GFP_KERNEL);
> --
> 2.17.1
>