[PATCH 1/3] media: staging: atomisp: Return an error code in case of error in 'lm3554_probe()'

2018-05-11 Thread Christophe JAILLET
of 'err' which was hiding this issue. Signed-off-by: Christophe JAILLET --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp

[PATCH 2/3] media: staging: atomisp: Fix an error handling path in 'lm3554_probe()'

2018-05-11 Thread Christophe JAILLET
The use of 'fail1' and 'fail2' is not correct. Reorder these calls to branch at the right place of the error handling path. Signed-off-by: Christophe JAILLET --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[PATCH 3/3] media: staging: atomisp: Fix usage of 'media_entity_cleanup()'

2018-05-11 Thread Christophe JAILLET
nup()' does nothing, but it is more future proof. Signed-off-by: Christophe JAILLET --- The change from '&flash->sd.entity' to '&sd->entity' in the last hunk is done because most of the drivers I've checked do it that way. Not sure if it is correct. I

[PATCH 0/3] media: staging: atomisp:

2018-05-11 Thread Christophe JAILLET
initialisation function fails. The 2nd one reorders own some label are reached in order to have a logical flow (first error goes to last label, last error goes to first label) The 3rd one fix the use 'media_entity_cleanup()'. If this one is correct, some other drivers will need to be fixed th

[PATCH] media: i2c: tda1997: Fix an error handling path 'tda1997x_probe()'

2018-05-07 Thread Christophe JAILLET
If 'media_entity_pads_init()' fails, we must free the resources allocated by 'v4l2_ctrl_handler_init()', as already done in the previous error handling path. 'goto' the right label to fix it. Fixes: 9ac0038db9a7 ("media: i2c: Add TDA1997x HDMI receiver driver&

[PATCH] media: bt8xx: Fix err 'bt878_probe()'

2017-09-21 Thread Christophe JAILLET
This is odd to call 'pci_disable_device()' in an error path before a coresponding successful 'pci_enable_device()'. Return directly instead. Fixes: 77e0be12100a ("V4L/DVB (4176): Bug-fix: Fix memory overflow") Signed-off-by: Christophe JAILLET --- drivers/medi

[PATCH V2] media: v4l2-pci-skeleton: Fix error handling path in 'skeleton_probe()'

2017-09-11 Thread Christophe JAILLET
If this memory allocation fails, we must release some resources, as already done in the code below and above. Signed-off-by: Christophe JAILLET --- v2: linux-media@vger.kernel.org added in cc --- samples/v4l/v4l2-pci-skeleton.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH] [media] smiapp: check memory allocation failure

2017-08-23 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case. Signed-off-by: Christophe JAILLET --- drivers/media/i2c/smiapp/smiapp-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index

[PATCH] Staging: media: Release the correct resource in an error handling path

2017-08-20 Thread Christophe JAILLET
eeded in the error handling path. Fixes: 4b4eda001704 ("Staging: media: Unmap and release region obtained by ioremap_nocache") Signed-off-by: Christophe JAILLET --- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v2] [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

2017-04-27 Thread Christophe JAILLET
We should ensure that 'plane_no' is '< vb->num_planes' as done in 'vb2_plane_cookie' just a few lines below. Cc: sta...@vger.kernel.org Fixes: e23ccc0ad925 ("[media] v4l: add videobuf2 Video for Linux 2 driver framework") Signed-off-by: Chr

Re: [PATCH 1/2] [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

2017-04-24 Thread Christophe JAILLET
Le 24/04/2017 à 22:29, Sakari Ailus a écrit : Hi Christophe, On Mon, Apr 24, 2017 at 10:00:24PM +0200, Christophe JAILLET wrote: Le 24/04/2017 à 16:16, Sakari Ailus a écrit : On Sun, Apr 23, 2017 at 11:32:57PM +0200, Christophe JAILLET wrote: We should ensure that 'plane_no'

Re: [PATCH 2/2] [media] vb2: Fix error handling in '__vb2_buf_mem_alloc'

2017-04-24 Thread Christophe JAILLET
Le 24/04/2017 à 16:23, Sakari Ailus a écrit : Hi Christophe, On Sun, Apr 23, 2017 at 11:40:30PM +0200, Christophe JAILLET wrote: 'call_ptr_memop' can return NULL, so we must test its return value with 'IS_ERR_OR_NULL'. Otherwise, the test 'if (mem_priv)'

Re: [PATCH 1/2] [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

2017-04-24 Thread Christophe JAILLET
Le 24/04/2017 à 16:16, Sakari Ailus a écrit : On Sun, Apr 23, 2017 at 11:32:57PM +0200, Christophe JAILLET wrote: We should ensure that 'plane_no' is '< vb->num_planes' as done in 'vb2_plane_cookie' just a few lines below. Signed-off-by: Christophe JA

[PATCH 1/2] [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

2017-04-23 Thread Christophe JAILLET
We should ensure that 'plane_no' is '< vb->num_planes' as done in 'vb2_plane_cookie' just a few lines below. Signed-off-by: Christophe JAILLET --- drivers/media/v4l2-core/videobuf2-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 2/2] [media] vb2: Fix error handling in '__vb2_buf_mem_alloc'

2017-04-23 Thread Christophe JAILLET
'call_ptr_memop' can return NULL, so we must test its return value with 'IS_ERR_OR_NULL'. Otherwise, the test 'if (mem_priv)' is meaningless. Signed-off-by: Christophe JAILLET --- Note that error checking after 'call_ptr_memop' calls is not consistent in

Re: [PATCH] [media] exynos4-is: Add missing 'of_node_put'

2017-02-25 Thread Christophe JAILLET
Le 24/02/2017 à 22:19, Javier Martinez Canillas a écrit : Thanks for the patch, but Krzysztof sent the exact same patch before [0]. There was feedback from Sylwester at the time that you can also look at [0]. Could you please take that into account and post a patch according to what he suggested

[PATCH v2] staging: bcm2835-camera: Fix a memory leak in error handling path in 'bm2835_mmal_init()'

2017-02-24 Thread Christophe JAILLET
If 'kzalloc()' fails, we should release resources allocated so far, just as done in all other cases in this function. Signed-off-by: Christophe JAILLET --- Not sure that the error handling path is correct. Is 'gdev[0]' freed? Should it be? v2: Rename patch to include 

[PATCH] [media] tm6000: Fix resource freeing in 'tm6000_prepare_isoc()'

2017-02-22 Thread Christophe JAILLET
tifier f; @@ * if (x == NULL) { ... when != x = e; ( *f(<+...x...+>); | *ret = f(<+...x...+>); ) ... } Signed-off-by: Christophe JAILLET --- drivers/media/usb/tm6000/tm6000-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH] [media] s5p-g2d: Fix error handling

2017-02-19 Thread Christophe JAILLET
According to the surrounding goto, it is likely that 'unprep_clk_gate' was expected here. Signed-off-by: Christophe JAILLET --- drivers/media/platform/s5p-g2d/g2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/medi

[PATCH] staging: bcm2835: Fix a memory leak in error handling path

2017-02-19 Thread Christophe JAILLET
If 'kzalloc()' fails, we should release resources allocated so far, just as done in all other cases in this function. Signed-off-by: Christophe JAILLET --- Not sure that the error handling path is correct. Is 'gdev[0]' freed? Should it be? --- drivers/staging/media/plat

[PATCH] [media] exynos4-is: Add missing 'of_node_put'

2017-01-23 Thread Christophe JAILLET
It is likely that a "of_node_put(ep)" is missing here. There is one in the previous error handling code, and one a few lines below in the normal case as well. Signed-off-by: Christophe JAILLET --- drivers/media/platform/exynos4-is/media-dev.c | 4 +++- 1 file changed, 3 insert

[PATCH] [media] soc-camera: Fix a return value in case of error

2016-11-18 Thread Christophe JAILLET
If 'ov9640_reg_read()' does not return 0, then 'val' is left unmodified. As it is not initialized either, the return value can be anything. It is likely that returning the error code was expected here. Signed-off-by: Christophe JAILLET --- drivers/media/i2c/soc_camera/ov9

[PATCH] [media] VPU: mediatek: Fix return value in case of error

2016-09-23 Thread Christophe JAILLET
If 'dma_alloc_coherent()' returns NULL, 'vpu_alloc_ext_mem()' will return 0 which means success. Return -ENOMEM instead. Signed-off-by: Christophe JAILLET --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver

[PATCH] [media] s5p_cec: Fix memory allocation failure check

2016-08-31 Thread Christophe JAILLET
It is likely that checking the result of the memory allocation just above is expected here. Signed-off-by: Christophe JAILLET --- drivers/staging/media/s5p-cec/s5p_cec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers

[PATCH] [media] drxd_hard: Add missing error code assignment before test

2016-08-10 Thread Christophe JAILLET
It is likely that checking the result of the 2nd 'read16' is expected here. Signed-off-by: Christophe JAILLET --- drivers/media/dvb-frontends/drxk_hard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb