V4L/DVB: soc-camera: module_put() fix
PATCH 1/1 V4L/DVB: soc-camera: module_put() fix
From: Magnus Damm <[email protected]>
Avoid calling module_put() if try_module_get() has been skipped.
Signed-off-by Magnus Damm <[email protected]>
---
drivers/media/video/soc_camera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/video/soc_camera.c +2 -1
@@ -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:
Quoted 14 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Avoid calling
module_put()iftry_module_get()has been skipped.Signed-off-by Magnus Damm <[email protected]>---
drivers/media/video/soc_camera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/video/soc_camera.c eiufmt: · line 1041
Quoted 9 lines
drivers/media/video/soc_camera.c +2
-1@@ -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