Re: [PATCH] V4L/DVB: soc-camera: module_put() fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 5 Jul 2010, Magnus Damm wrote:

> From: Magnus Damm <damm@xxxxxxxxxxxxx>
> 
> Avoid calling module_put() if try_module_get() has
> been skipped.
> 
> Signed-off-by: Magnus Damm <damm@xxxxxxxxxxxxx>
> ---
> 
>  drivers/media/video/soc_camera.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> --- 0001/drivers/media/video/soc_camera.c
> +++ work/drivers/media/video/soc_camera.c	2010-06-23 13:43:05.000000000 +0900
> @@ -1034,7 +1034,8 @@ eiufmt:
>  		soc_camera_free_i2c(icd);
>  	} else {
>  		icl->del_device(icl);
> -		module_put(control->driver->owner);
> +		if (control && control->driver && control->driver->owner)
> +			module_put(control->driver->owner);
>  	}
>  enodrv:
>  eadddev:

Hm, don't understand. I don't see how this can be a problem. Have you hit 
a case, when you enter this path with one of those pointers == NULL? 
Looking at the code, this is only entered from eiufmt or evidstart "if 
(!icl->board_info)" (i.e., only with the soc_camera_platform driver). And 
if you got down to one of those errors, you do have all those pointers in 
place. What am I missing?

Thanks
Guennadi
---
Guennadi Liakhovetski
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux