* [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe()
@ 2016-12-23 22:15 Alexey Khoroshilov
2016-12-26 22:04 ` Stefan Wahren
0 siblings, 1 reply; 4+ messages in thread
From: Alexey Khoroshilov @ 2016-12-23 22:15 UTC (permalink / raw)
To: Jonathan Cameron, Stefan Wahren, Dmitry Torokhov
Cc: Alexey Khoroshilov, linux-iio, linux-kernel, ldv-project
During transition to using devm_input_allocate_device()
goto to resource deallocation block was replaced by return
in case of error in iio_device_register().
That is wrong since resources are left undeallocated.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: 962ed43a3eac ("iio: mxs-lradc: remove mxs_lradc_ts_unregister")
---
drivers/iio/adc/mxs-lradc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
index b84d37c80a94..1ab0caeb3577 100644
--- a/drivers/iio/adc/mxs-lradc.c
+++ b/drivers/iio/adc/mxs-lradc.c
@@ -1702,7 +1702,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
ret = iio_device_register(iio);
if (ret) {
dev_err(dev, "Failed to register IIO device\n");
- return ret;
+ goto err_ts_register;
}
return 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe()
2016-12-23 22:15 [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe() Alexey Khoroshilov
@ 2016-12-26 22:04 ` Stefan Wahren
2016-12-30 19:09 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2016-12-26 22:04 UTC (permalink / raw)
To: Alexey Khoroshilov, Jonathan Cameron, Dmitry Torokhov
Cc: linux-kernel, ldv-project, linux-iio, lee.jones
> Alexey Khoroshilov <khoroshilov@ispras.ru> hat am 23. Dezember 2016 um 23:15 geschrieben:
>
>
> During transition to using devm_input_allocate_device()
> goto to resource deallocation block was replaced by return
> in case of error in iio_device_register().
> That is wrong since resources are left undeallocated.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> Fixes: 962ed43a3eac ("iio: mxs-lradc: remove mxs_lradc_ts_unregister")
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
But since Ksenija's patch series [1] (which doesn't have this issue) this patch is only relevant for stable.
Thanks
[1] - http://marc.info/?l=linux-iio&m=148131774219426&w=2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe()
2016-12-26 22:04 ` Stefan Wahren
@ 2016-12-30 19:09 ` Jonathan Cameron
2016-12-30 20:16 ` Stefan Wahren
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2016-12-30 19:09 UTC (permalink / raw)
To: Stefan Wahren, Alexey Khoroshilov, Dmitry Torokhov
Cc: linux-kernel, ldv-project, linux-iio, lee.jones
On 26/12/16 22:04, Stefan Wahren wrote:
>
>> Alexey Khoroshilov <khoroshilov@ispras.ru> hat am 23. Dezember 2016 um 23:15 geschrieben:
>>
>>
>> During transition to using devm_input_allocate_device()
>> goto to resource deallocation block was replaced by return
>> in case of error in iio_device_register().
>> That is wrong since resources are left undeallocated.
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>> Fixes: 962ed43a3eac ("iio: mxs-lradc: remove mxs_lradc_ts_unregister")
>
> Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
>
> But since Ksenija's patch series [1] (which doesn't have this issue) this patch is only relevant for stable.
It's slightly doubtful as stable material as well unless it causes
a crash. Obviously failing to clean up isn't good, but its not critical
enough to justify the churn.
Good find though.
Should you wish to post it to stable and let the stable maintainers make
a decision feel free to do so.
Jonathan
>
> Thanks
>
> [1] - http://marc.info/?l=linux-iio&m=148131774219426&w=2
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe()
2016-12-30 19:09 ` Jonathan Cameron
@ 2016-12-30 20:16 ` Stefan Wahren
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Wahren @ 2016-12-30 20:16 UTC (permalink / raw)
To: Alexey Khoroshilov, Jonathan Cameron, Dmitry Torokhov
Cc: lee.jones, linux-kernel, ldv-project, linux-iio
> Jonathan Cameron <jic23@kernel.org> hat am 30. Dezember 2016 um 20:09 geschrieben:
>
>
> On 26/12/16 22:04, Stefan Wahren wrote:
> >
> >> Alexey Khoroshilov <khoroshilov@ispras.ru> hat am 23. Dezember 2016 um 23:15 geschrieben:
> >>
> >>
> >> During transition to using devm_input_allocate_device()
> >> goto to resource deallocation block was replaced by return
> >> in case of error in iio_device_register().
> >> That is wrong since resources are left undeallocated.
> >>
> >> Found by Linux Driver Verification project (linuxtesting.org).
> >>
> >> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> >> Fixes: 962ed43a3eac ("iio: mxs-lradc: remove mxs_lradc_ts_unregister")
> >
> > Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
> >
> > But since Ksenija's patch series [1] (which doesn't have this issue) this patch is only relevant for stable.
> It's slightly doubtful as stable material as well unless it causes
> a crash. Obviously failing to clean up isn't good, but its not critical
> enough to justify the churn.
>
> Good find though.
>
> Should you wish to post it to stable and let the stable maintainers make
> a decision feel free to do so.
No, i don't have any plans for that.
>
> Jonathan
> >
> > Thanks
> >
> > [1] - http://marc.info/?l=linux-iio&m=148131774219426&w=2
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-30 20:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23 22:15 [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe() Alexey Khoroshilov
2016-12-26 22:04 ` Stefan Wahren
2016-12-30 19:09 ` Jonathan Cameron
2016-12-30 20:16 ` Stefan Wahren
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).