linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: dw100: Fix an error handling path in dw100_probe()
@ 2022-08-22  9:40 Christophe JAILLET
  2022-08-22  9:56 ` Laurent Pinchart
  2022-08-22 10:18 ` Dan Carpenter
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2022-08-22  9:40 UTC (permalink / raw)
  To: Xavier Roumegue, Mauro Carvalho Chehab, Ezequiel Garcia,
	Hans Verkuil, Laurent Pinchart
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-media

After a successful call to media_device_init() it is safer to call
media_device_init().

Add the missing call in the error handling path of the probe, as already
done in the remove function.

Fixes: bd090d4d995a ("media: dw100: Add i.MX8MP dw100 dewarper driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/platform/nxp/dw100/dw100.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c
index 94518f0e486b..b3b057798ab6 100644
--- a/drivers/media/platform/nxp/dw100/dw100.c
+++ b/drivers/media/platform/nxp/dw100/dw100.c
@@ -1623,6 +1623,7 @@ static int dw100_probe(struct platform_device *pdev)
 error_v4l2:
 	video_unregister_device(vfd);
 err_m2m:
+	media_device_cleanup(&dw_dev->mdev);
 	v4l2_m2m_release(dw_dev->m2m_dev);
 err_v4l2:
 	v4l2_device_unregister(&dw_dev->v4l2_dev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: dw100: Fix an error handling path in dw100_probe()
  2022-08-22  9:40 [PATCH] media: dw100: Fix an error handling path in dw100_probe() Christophe JAILLET
@ 2022-08-22  9:56 ` Laurent Pinchart
  2022-08-22 10:54   ` Christophe JAILLET
  2022-08-22 10:18 ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2022-08-22  9:56 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Xavier Roumegue, Mauro Carvalho Chehab, Ezequiel Garcia,
	Hans Verkuil, linux-kernel, kernel-janitors, linux-media

Hi Christophe,

Thank you for the patch.

On Mon, Aug 22, 2022 at 11:40:43AM +0200, Christophe JAILLET wrote:
> After a successful call to media_device_init() it is safer to call
> media_device_init().

I assume you meant media_device_cleanup() ? With this fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Add the missing call in the error handling path of the probe, as already
> done in the remove function.
> 
> Fixes: bd090d4d995a ("media: dw100: Add i.MX8MP dw100 dewarper driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/media/platform/nxp/dw100/dw100.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c
> index 94518f0e486b..b3b057798ab6 100644
> --- a/drivers/media/platform/nxp/dw100/dw100.c
> +++ b/drivers/media/platform/nxp/dw100/dw100.c
> @@ -1623,6 +1623,7 @@ static int dw100_probe(struct platform_device *pdev)
>  error_v4l2:
>  	video_unregister_device(vfd);
>  err_m2m:
> +	media_device_cleanup(&dw_dev->mdev);
>  	v4l2_m2m_release(dw_dev->m2m_dev);
>  err_v4l2:
>  	v4l2_device_unregister(&dw_dev->v4l2_dev);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: dw100: Fix an error handling path in dw100_probe()
  2022-08-22  9:40 [PATCH] media: dw100: Fix an error handling path in dw100_probe() Christophe JAILLET
  2022-08-22  9:56 ` Laurent Pinchart
@ 2022-08-22 10:18 ` Dan Carpenter
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-08-22 10:18 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Xavier Roumegue, Mauro Carvalho Chehab, Ezequiel Garcia,
	Hans Verkuil, Laurent Pinchart, linux-kernel, kernel-janitors,
	linux-media

On Mon, Aug 22, 2022 at 11:40:43AM +0200, Christophe JAILLET wrote:
> After a successful call to media_device_init() it is safer to call
> media_device_init().

s/media_device_init/media_device_cleanup/.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: dw100: Fix an error handling path in dw100_probe()
  2022-08-22  9:56 ` Laurent Pinchart
@ 2022-08-22 10:54   ` Christophe JAILLET
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2022-08-22 10:54 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Xavier Roumegue, Mauro Carvalho Chehab, Ezequiel Garcia,
	Hans Verkuil, linux-kernel, kernel-janitors, linux-media

Le 22/08/2022 à 11:56, Laurent Pinchart a écrit :
> Hi Christophe,
> 
> Thank you for the patch.
> 
> On Mon, Aug 22, 2022 at 11:40:43AM +0200, Christophe JAILLET wrote:
>> After a successful call to media_device_init() it is safer to call
>> media_device_init().
> 
> I assume you meant media_device_cleanup() ? With this fixed,

+1.
I assume that it can be fixed when applied (otherwise tell me and I'll 
send a v2).

CJ

> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
>> Add the missing call in the error handling path of the probe, as already
>> done in the remove function.
>>
>> Fixes: bd090d4d995a ("media: dw100: Add i.MX8MP dw100 dewarper driver")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   drivers/media/platform/nxp/dw100/dw100.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c
>> index 94518f0e486b..b3b057798ab6 100644
>> --- a/drivers/media/platform/nxp/dw100/dw100.c
>> +++ b/drivers/media/platform/nxp/dw100/dw100.c
>> @@ -1623,6 +1623,7 @@ static int dw100_probe(struct platform_device *pdev)
>>   error_v4l2:
>>   	video_unregister_device(vfd);
>>   err_m2m:
>> +	media_device_cleanup(&dw_dev->mdev);
>>   	v4l2_m2m_release(dw_dev->m2m_dev);
>>   err_v4l2:
>>   	v4l2_device_unregister(&dw_dev->v4l2_dev);
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-22 10:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  9:40 [PATCH] media: dw100: Fix an error handling path in dw100_probe() Christophe JAILLET
2022-08-22  9:56 ` Laurent Pinchart
2022-08-22 10:54   ` Christophe JAILLET
2022-08-22 10:18 ` Dan Carpenter

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).