[PATCH] hwmon: (xgene) Fix up error handling path mixup in 'xgene_hwmon_probe()'

2017-09-23 Thread Christophe JAILLET
to 'out_mbox_free' - 'goto out_mbox_free' must be replaced by 'goto out', otherwise the '[pcc_]mbox_free_channel()' call will be missed. Fixes: 2ca492e22cb7 ("hwmon: (xgene) Fix crash when alarm occurs before driver probe") Signed-off-by: Christophe JAILLET --- drivers/hwmon/xgene-hw

[PATCH 2/3] iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/iio/adc/twl4030-madc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c index 80ab2ed70b85..32d

[PATCH 2/3] iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET --- drivers/iio/adc/twl4030-madc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c index 80ab2ed70b85..32db23d9a483 100644 --- a/drivers/iio/a

[PATCH 3/3] iio: adc: twl4030: Return an error if we can not enable the vusb3v1 regulator in 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
If we can not enable the regulator, go through the error handling path instead of silently continuing. Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- This patch is highly speculative. I do

[PATCH 3/3] iio: adc: twl4030: Return an error if we can not enable the vusb3v1 regulator in 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
If we can not enable the regulator, go through the error handling path instead of silently continuing. Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET --- This patch is highly speculative. I don't find logical to return an error if we

[PATCH 1/3] iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
If 'devm_regulator_get()' fails, we should go through the existing error handling path instead of returning directly, as done is all the other error handling paths in this function. Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET <ch

[PATCH 1/3] iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
If 'devm_regulator_get()' fails, we should go through the existing error handling path instead of returning directly, as done is all the other error handling paths in this function. Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET --

[PATCH 0/3] iio: adc: twl4030: Fix some error handling issues in 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
dling path - missing function in the error handling path - spurious pattern (IMO) if unable to enable a regulator I have splitted them in 3 parts. Christophe JAILLET (3): iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()' iio: adc: twl4030: Disable the vusb3v1

[PATCH 0/3] iio: adc: twl4030: Fix some error handling issues in 'twl4030_madc_probe()'

2017-09-23 Thread Christophe JAILLET
dling path - missing function in the error handling path - spurious pattern (IMO) if unable to enable a regulator I have splitted them in 3 parts. Christophe JAILLET (3): iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()' iio: adc: twl4030: Disable the vusb3v1

[PATCH] staging: rtl8192u: Fix some error handling path

2017-09-22 Thread Christophe JAILLET
will be handled by 'rtl8192_usb_prob()' directly. The calling graph is: rtl8192_usb_probe --> rtl8192_init --> rtl8192_usb_initendpoints Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- This patch is compile tested and the corresponding looks a bit tricky

[PATCH] staging: rtl8192u: Fix some error handling path

2017-09-22 Thread Christophe JAILLET
will be handled by 'rtl8192_usb_prob()' directly. The calling graph is: rtl8192_usb_probe --> rtl8192_init --> rtl8192_usb_initendpoints Signed-off-by: Christophe JAILLET --- This patch is compile tested and the corresponding looks a bit tricky. So, review carefully :) --- drivers/s

[PATCH] staging: rtl8192u: Check some memory allocation failure

2017-09-22 Thread Christophe JAILLET
is: rtl8192_usb_probe --> rtl8192_init --> rtl8192_usb_initendpoints Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- The error handling path in 'rtl8192_usb_probe' must also be fixed because it is bogus. Will do that in another patch. --- drivers/stag

[PATCH] staging: rtl8192u: Check some memory allocation failure

2017-09-22 Thread Christophe JAILLET
is: rtl8192_usb_probe --> rtl8192_init --> rtl8192_usb_initendpoints Signed-off-by: Christophe JAILLET --- The error handling path in 'rtl8192_usb_probe' must also be fixed because it is bogus. Will do that in another patch. --- drivers/staging/rtl8192u/r8192U_core.c | 4 1 file chan

[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 <christophe.jail...@wanadoo.fr> --

[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/media/pci/bt8xx/bt878.c

Re: [PATCH] lib/lz4: make arrays static const, reduces object code size

2017-09-21 Thread Christophe JAILLET
Le 22/09/2017 à 00:19, Colin King a écrit : From: Colin Ian King Don't populate the read-only arrays dec32table and dec64table on the stack, instead make them both static const. Makes the object code smaller by over 10K bytes: 10k? Wouaouh! This is way much more than

Re: [PATCH] lib/lz4: make arrays static const, reduces object code size

2017-09-21 Thread Christophe JAILLET
Le 22/09/2017 à 00:19, Colin King a écrit : From: Colin Ian King Don't populate the read-only arrays dec32table and dec64table on the stack, instead make them both static const. Makes the object code smaller by over 10K bytes: 10k? Wouaouh! This is way much more than what you usually win with

[PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()'

2017-09-21 Thread Christophe JAILLET
All the error handling paths 'goto error', except this one. We should also go to error in this case, or some resources will be leaking. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/broadcom/cnic.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()'

2017-09-21 Thread Christophe JAILLET
All the error handling paths 'goto error', except this one. We should also go to error in this case, or some resources will be leaking. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/broadcom/cnic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net

[PATCH 2/2] rapidio: Fix an error handling in 'rio_dma_transfer()'

2017-09-17 Thread Christophe JAILLET
In case of error, 'dma_map_sg()' returns 0, not a negative value. There is BUG_ON() in 'dma_map_sg_attrs()' which makes sure of that. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/rapidio/devices/rio_mport_cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 1/2] rapidio: Fix resources leak in error handling path in 'rio_dma_transfer()'

2017-09-17 Thread Christophe JAILLET
If 'dma_map_sg()', we should branch to the existing error handling path to free some resources before returning. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/rapidio/devices/rio_mport_cdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH 2/2] rapidio: Fix an error handling in 'rio_dma_transfer()'

2017-09-17 Thread Christophe JAILLET
In case of error, 'dma_map_sg()' returns 0, not a negative value. There is BUG_ON() in 'dma_map_sg_attrs()' which makes sure of that. Signed-off-by: Christophe JAILLET --- drivers/rapidio/devices/rio_mport_cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 1/2] rapidio: Fix resources leak in error handling path in 'rio_dma_transfer()'

2017-09-17 Thread Christophe JAILLET
If 'dma_map_sg()', we should branch to the existing error handling path to free some resources before returning. Signed-off-by: Christophe JAILLET --- drivers/rapidio/devices/rio_mport_cdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rapidio/devices

[PATCH 0/2] rapidio: Two fixes for 'rio_dma_transfer()'

2017-09-17 Thread Christophe JAILLET
looks trivial to me. But the 2nd one should require more attention, IMO. The existing error handling was dead code because 'dma_map_sg()' can not return -EFAULT. So this error handling code has never been executed/tested and I can't test it myself. Christophe JAILLET (2): rapidio: Fix resources leak

[PATCH 0/2] rapidio: Two fixes for 'rio_dma_transfer()'

2017-09-17 Thread Christophe JAILLET
looks trivial to me. But the 2nd one should require more attention, IMO. The existing error handling was dead code because 'dma_map_sg()' can not return -EFAULT. So this error handling code has never been executed/tested and I can't test it myself. Christophe JAILLET (2): rapidio: Fix resources leak

[PATCH] regulator: qcom_spmi: Fix an error handling path in 'qcom_spmi_regulator_probe()'

2017-09-17 Thread Christophe JAILLET
If a memory allocation fails, we should go through the error handling path, as done elsewhere in this 'for' loop. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/regulator/qcom_spmi-regulator.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH] regulator: qcom_spmi: Fix an error handling path in 'qcom_spmi_regulator_probe()'

2017-09-17 Thread Christophe JAILLET
If a memory allocation fails, we should go through the error handling path, as done elsewhere in this 'for' loop. Signed-off-by: Christophe JAILLET --- drivers/regulator/qcom_spmi-regulator.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/qcom_spmi

[PATCH] tty: synclink: Reuse an existing error handling path

2017-09-17 Thread Christophe JAILLET
In order to avoid code duplication and to be more consistent with the other error handling paths in this function, we should 'goto errout'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/tty/synclink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[PATCH] tty: synclink: Reuse an existing error handling path

2017-09-17 Thread Christophe JAILLET
In order to avoid code duplication and to be more consistent with the other error handling paths in this function, we should 'goto errout'. Signed-off-by: Christophe JAILLET --- drivers/tty/synclink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/synclink.c b

[PATCH] dlm: Reuse existing error handling path

2017-09-17 Thread Christophe JAILLET
The error handling path at label 'accept_err' already performs these 'sock_release()' and 'mutex_unlock()' calls. The order is reversed, but it is not important. So avoid code duplication and 'goto accept_err'. While at it, add some missing spaces around a '='. Signed-off-by: Christophe JAILLET

[PATCH] dlm: Reuse existing error handling path

2017-09-17 Thread Christophe JAILLET
The error handling path at label 'accept_err' already performs these 'sock_release()' and 'mutex_unlock()' calls. The order is reversed, but it is not important. So avoid code duplication and 'goto accept_err'. While at it, add some missing spaces around a '='. Signed-off-by: Christophe JAILLET

[PATCH] perf script: Fix error handling path

2017-09-16 Thread Christophe JAILLET
If the string passed in '--time' is invalid, or if failed to set libtraceevent function resolver, we must do some cleanup before leaving. As in the other error handling paths of this function. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- tools/perf/builtin-script

[PATCH] perf script: Fix error handling path

2017-09-16 Thread Christophe JAILLET
If the string passed in '--time' is invalid, or if failed to set libtraceevent function resolver, we must do some cleanup before leaving. As in the other error handling paths of this function. Signed-off-by: Christophe JAILLET --- tools/perf/builtin-script.c | 6 -- 1 file changed, 4

[PATCH] perf kmem: Perform some cleanup if '--time' is given an invalid value

2017-09-16 Thread Christophe JAILLET
If the string passed in '--time' is invalid, we must do some cleanup before leaving. As in the other error handling paths of this function. Fixes: 2a865bd8 ("perf kmem: Add option to specify time window of interest") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.f

[PATCH] perf kmem: Perform some cleanup if '--time' is given an invalid value

2017-09-16 Thread Christophe JAILLET
If the string passed in '--time' is invalid, we must do some cleanup before leaving. As in the other error handling paths of this function. Fixes: 2a865bd8 ("perf kmem: Add option to specify time window of interest") Signed-off-by: Christophe JAILLET --- tools/perf/builtin-kmem.c

[PATCH] ASoC: davinci-mcasp: Fix an error handling path in 'davinci_mcasp_probe()'

2017-09-15 Thread Christophe JAILLET
mcasp: Add set_tdm_slots() support") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- sound/soc/davinci/davinci-mcasp.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c in

[PATCH] ASoC: davinci-mcasp: Fix an error handling path in 'davinci_mcasp_probe()'

2017-09-15 Thread Christophe JAILLET
mcasp: Add set_tdm_slots() support") Signed-off-by: Christophe JAILLET --- sound/soc/davinci/davinci-mcasp.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index f395bbc7c354..23b0da7df1f2 100644 -

[PATCH] scsi: fdomain: Fix a resource leak in an error handling path in '__fdomain_16x0_detect()'

2017-09-15 Thread Christophe JAILLET
All error handling paths 'goto fail' in this function. If 'scsi_register()' fails, we should also go there, otherwise a 'pci_dev_put(pdev)' will be missing. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- In order to keep consistance with the rest of the file, I've i

[PATCH] scsi: fdomain: Fix a resource leak in an error handling path in '__fdomain_16x0_detect()'

2017-09-15 Thread Christophe JAILLET
All error handling paths 'goto fail' in this function. If 'scsi_register()' fails, we should also go there, otherwise a 'pci_dev_put(pdev)' will be missing. Signed-off-by: Christophe JAILLET --- In order to keep consistance with the rest of the file, I've ignored checkpatch warnings about spaces

[PATCH 2/2] ASoC: topology: Fix a potential memory leak in 'soc_tplg_dapm_widget_denum_create()'

2017-09-14 Thread Christophe JAILLET
If this sanity check fails, we must free the memory that has already been allocated. So we must go to 'err' as in the other error handling parth of this function. Fixes: 1a7dd6e2f192 ("ASoC: topology: Allow a widget to have multiple enum controls") Signed-off-by: Christop

[PATCH 2/2] ASoC: topology: Fix a potential memory leak in 'soc_tplg_dapm_widget_denum_create()'

2017-09-14 Thread Christophe JAILLET
If this sanity check fails, we must free the memory that has already been allocated. So we must go to 'err' as in the other error handling parth of this function. Fixes: 1a7dd6e2f192 ("ASoC: topology: Allow a widget to have multiple enum controls") Signed-off-by: Christophe JAILLET

[PATCH 1/2] ASoC: topology: Fix a potential NULL pointer dereference in 'soc_tplg_dapm_widget_denum_create()'

2017-09-14 Thread Christophe JAILLET
ones. Fixes: 1a7dd6e2f192 ("ASoC: topology: Allow a widget to have multiple enum controls") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- sound/soc/soc-topology.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-

[PATCH 1/2] ASoC: topology: Fix a potential NULL pointer dereference in 'soc_tplg_dapm_widget_denum_create()'

2017-09-14 Thread Christophe JAILLET
ones. Fixes: 1a7dd6e2f192 ("ASoC: topology: Allow a widget to have multiple enum controls") Signed-off-by: Christophe JAILLET --- sound/soc/soc-topology.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index dd471d2c0266..24

[PATCH] scsi: libiscsi: Fix an error handling path in 'iscsi_session_setup()'

2017-09-13 Thread Christophe JAILLET
All error handling paths in this function go through 'iscsi_host_dec_session_cnt()' except this one. Fix it and properly decrement the number of active sessions in such a case. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/libiscsi.c | 2 +- 1 file chan

[PATCH] scsi: libiscsi: Fix an error handling path in 'iscsi_session_setup()'

2017-09-13 Thread Christophe JAILLET
All error handling paths in this function go through 'iscsi_host_dec_session_cnt()' except this one. Fix it and properly decrement the number of active sessions in such a case. Signed-off-by: Christophe JAILLET --- drivers/scsi/libiscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] video: fbdev: Fix an errro handling path in 'au1200fb_drv_probe()'

2017-09-11 Thread Christophe JAILLET
If 'dmam_alloc_attrs()' fails, we must go through the error handling code, as done elsewhere in this function. Otherwise, there is a resource leak. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- I'm also puzzled by the 'framebuffer_alloc()' call a few lines above

[PATCH] video: fbdev: Fix an errro handling path in 'au1200fb_drv_probe()'

2017-09-11 Thread Christophe JAILLET
If 'dmam_alloc_attrs()' fails, we must go through the error handling code, as done elsewhere in this function. Otherwise, there is a resource leak. Signed-off-by: Christophe JAILLET --- I'm also puzzled by the 'framebuffer_alloc()' call a few lines above. 'ret' is known to be 0 at this point. I

Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

2017-09-11 Thread Christophe JAILLET
Le 11/09/2017 à 21:52, Jens Axboe a écrit : On 09/11/2017 01:43 PM, Christophe JAILLET wrote: If the 'kmalloc' fails, we must go through the existing error handling path. Looks good to me, probably wants a Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-spe

Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

2017-09-11 Thread Christophe JAILLET
Le 11/09/2017 à 21:52, Jens Axboe a écrit : On 09/11/2017 01:43 PM, Christophe JAILLET wrote: If the 'kmalloc' fails, we must go through the existing error handling path. Looks good to me, probably wants a Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-spe

[PATCH v2] openvswitch: Fix an error handling path in 'ovs_nla_init_match_and_action()'

2017-09-11 Thread Christophe JAILLET
All other error handling paths in this function go through the 'error' label. This one should do the same. Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- I think that the comment above th

[PATCH v2] openvswitch: Fix an error handling path in 'ovs_nla_init_match_and_action()'

2017-09-11 Thread Christophe JAILLET
All other error handling paths in this function go through the 'error' label. This one should do the same. Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Christophe JAILLET --- I think that the comment above the function could be improved. It

[PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

2017-09-11 Thread Christophe JAILLET
If the 'kmalloc' fails, we must go through the existing error handling path. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- mm/backing-dev.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index f028a9

[PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

2017-09-11 Thread Christophe JAILLET
If the 'kmalloc' fails, we must go through the existing error handling path. Signed-off-by: Christophe JAILLET --- mm/backing-dev.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index f028a9a472fd..e19606bb41a0 100644 --- a/mm

[PATCH] datapath: Fix an error handling path in 'ovs_nla_init_match_and_action()'

2017-09-11 Thread Christophe JAILLET
All other error handling paths in this function go through the 'error' label. This one should do the same. Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- I think that the comment above th

[PATCH] datapath: Fix an error handling path in 'ovs_nla_init_match_and_action()'

2017-09-11 Thread Christophe JAILLET
All other error handling paths in this function go through the 'error' label. This one should do the same. Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") Signed-off-by: Christophe JAILLET --- I think that the comment above the function could be improved. It

[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 <christophe.jail...@wanadoo.fr> --- v2: linux-me...@vger.kernel.org added in cc --- samples/v4l/v4l2-pci-skeleton.c | 6 -- 1 file chan

[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-me...@vger.kernel.org added in cc --- samples/v4l/v4l2-pci-skeleton.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

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

2017-09-10 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 <christophe.jail...@wanadoo.fr> --- samples/v4l/v4l2-pci-skeleton.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/s

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

2017-09-10 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 --- samples/v4l/v4l2-pci-skeleton.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples

[PATCH] btrfs: tests: Fix a memory leak in error handling path in 'run_test()'

2017-09-10 Thread Christophe JAILLET
If 'btrfs_alloc_path()' fails, we must free the resourses already allocated, as done in the other error handling paths in this function. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- fs/btrfs/tests/free-space-tree-tests.c | 3 ++- 1 file changed, 2 insertions

[PATCH] btrfs: tests: Fix a memory leak in error handling path in 'run_test()'

2017-09-10 Thread Christophe JAILLET
If 'btrfs_alloc_path()' fails, we must free the resourses already allocated, as done in the other error handling paths in this function. Signed-off-by: Christophe JAILLET --- fs/btrfs/tests/free-space-tree-tests.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs

[PATCH] drm/i915: Fix an error handling in 'intel_framebuffer_init()'

2017-09-10 Thread Christophe JAILLET
We should go through the error handling path to decrease the 'framebuffer_references' as done everywhere else in this function. Fixes: 2e2adb05736c ("drm/i915: Add render decompression support") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- driv

[PATCH] drm/i915: Fix an error handling in 'intel_framebuffer_init()'

2017-09-10 Thread Christophe JAILLET
We should go through the error handling path to decrease the 'framebuffer_references' as done everywhere else in this function. Fixes: 2e2adb05736c ("drm/i915: Add render decompression support") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/i915/intel_display.c | 2 +- 1 file

[PATCH] ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()

2017-09-03 Thread Christophe JAILLET
If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. Othewise, there is a resource leak. Fixes: f5c97c7b0438 ("ASoC: samsung: i2s: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- I'm no

[PATCH] ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()

2017-09-03 Thread Christophe JAILLET
If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. Othewise, there is a resource leak. Fixes: f5c97c7b0438 ("ASoC: samsung: i2s: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET --- I'm not 100% confident in this patch. It is mostl

[PATCH] mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_probe()

2017-09-03 Thread Christophe JAILLET
If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. Fixes: 4d26f012ab59 ("mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Labels in the error handling path could be rena

[PATCH] mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_probe()

2017-09-03 Thread Christophe JAILLET
If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. Fixes: 4d26f012ab59 ("mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET --- Labels in the error handling path could be renamed, but it does not worth the ef

Re: [PATCH] ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'

2017-08-31 Thread Christophe JAILLET
Le 31/08/2017 à 12:38, Mark Brown a écrit : On Thu, Aug 31, 2017 at 12:31:33PM +0200, Takashi Iwai wrote: This is again a typical problem by such a trivial fix patch: the code looks as if it were trivial and correct, buried in a patch series that easily leads to the oversight by the

Re: [PATCH] ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'

2017-08-31 Thread Christophe JAILLET
Le 31/08/2017 à 12:38, Mark Brown a écrit : On Thu, Aug 31, 2017 at 12:31:33PM +0200, Takashi Iwai wrote: This is again a typical problem by such a trivial fix patch: the code looks as if it were trivial and correct, buried in a patch series that easily leads to the oversight by the

[PATCH] ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'

2017-08-30 Thread Christophe JAILLET
If 'clk_prepare_enable()' fails, we must release some resources before returning. Add a new label in the existing error handling path and 'goto' there. Fixes: 260ea95cc027 ("ASoC: atmel: ac97c: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET <ch

[PATCH] ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'

2017-08-30 Thread Christophe JAILLET
If 'clk_prepare_enable()' fails, we must release some resources before returning. Add a new label in the existing error handling path and 'goto' there. Fixes: 260ea95cc027 ("ASoC: atmel: ac97c: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET --- s

[PATCH] driver core: bus: Fix a potential double free

2017-08-29 Thread Christophe JAILLET
The .release function of driver_ktype is 'driver_release()'. This function frees the container_of this kobject. So, this memory must not be freed explicitly in the error handling path of 'bus_add_driver()'. Otherwise a double free will occur. Signed-off-by: Christophe JAILLET <christophe.j

[PATCH] driver core: bus: Fix a potential double free

2017-08-29 Thread Christophe JAILLET
The .release function of driver_ktype is 'driver_release()'. This function frees the container_of this kobject. So, this memory must not be freed explicitly in the error handling path of 'bus_add_driver()'. Otherwise a double free will occur. Signed-off-by: Christophe JAILLET --- I have left

Re: [PATCH] igb: check memory allocation failure

2017-08-28 Thread Christophe JAILLET
Le 28/08/2017 à 01:09, Waskiewicz Jr, Peter a écrit : On 8/27/17 2:42 AM, Christophe JAILLET wrote: Check memory allocation failures and return -ENOMEM in such cases, as already done for other memory allocations in this function. This avoids NULL pointers dereference. Signed-off

Re: [PATCH] igb: check memory allocation failure

2017-08-28 Thread Christophe JAILLET
Le 28/08/2017 à 01:09, Waskiewicz Jr, Peter a écrit : On 8/27/17 2:42 AM, Christophe JAILLET wrote: Check memory allocation failures and return -ENOMEM in such cases, as already done for other memory allocations in this function. This avoids NULL pointers dereference. Signed-off

[PATCH] ASoC: davinci-mcasp: check memory allocation failure

2017-08-27 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done above for another memory allocation. This avoids NULL pointers dereference. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- sound/soc/davinci/davinci-mcasp.c | 4 1 file chan

[PATCH] ASoC: davinci-mcasp: check memory allocation failure

2017-08-27 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done above for another memory allocation. This avoids NULL pointers dereference. Signed-off-by: Christophe JAILLET --- sound/soc/davinci/davinci-mcasp.c | 4 1 file changed, 4 insertions(+) diff --git a/sound

[PATCH] igb: check memory allocation failure

2017-08-27 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done for other memory allocations in this function. This avoids NULL pointers dereference. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/intel/igb/igb_main.c | 2 ++

[PATCH] igb: check memory allocation failure

2017-08-27 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done for other memory allocations in this function. This avoids NULL pointers dereference. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/intel/igb/igb_main.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH] libnvdimm, btt: check memory allocation failure

2017-08-27 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done few lines below for another memory allocation. This avoids NULL pointers dereference. Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7 format") Signed-off-by: Christophe JAILLET <ch

[PATCH] libnvdimm, btt: check memory allocation failure

2017-08-27 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done few lines below for another memory allocation. This avoids NULL pointers dereference. Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7 format") Signed-off-by: Christophe JAILLET --- driv

[PATCH] iio: multiplexer: check memory allocation failure

2017-08-25 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done few lines above for another memory allocation. This avoids NULL pointers dereference. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/iio/multiplexer/iio-mux.c | 6 ++

[PATCH] iio: multiplexer: check memory allocation failure

2017-08-25 Thread Christophe JAILLET
Check memory allocation failures and return -ENOMEM in such cases, as already done few lines above for another memory allocation. This avoids NULL pointers dereference. Signed-off-by: Christophe JAILLET --- drivers/iio/multiplexer/iio-mux.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH] net: sxgbe: check memory allocation failure

2017-08-24 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done few lines below for another memory allocation. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 2 ++ 1 file changed, 2 inse

[PATCH] net: sxgbe: check memory allocation failure

2017-08-24 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done few lines below for another memory allocation. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet

[PATCH] usb: chipidea: usb2: check memory allocation failure

2017-08-24 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done few lines below for another memory allocation. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/usb/chipidea/ci_hdrc_usb2.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH] usb: chipidea: usb2: check memory allocation failure

2017-08-24 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done few lines below for another memory allocation. Signed-off-by: Christophe JAILLET --- drivers/usb/chipidea/ci_hdrc_usb2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c

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

2017-08-24 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- 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/

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

2017-08-24 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] drm/amdgpu: check memory allocation failure

2017-08-23 Thread Christophe JAILLET
in amdgpu_cs_process_syncobj_out_dep() ---> error code returned by amdgpu_cs_dependencies() --> amdgpu_cs_parser_fini() is called Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +++ 1 file changed, 3 insertions(+) diff --g

[PATCH] drm/amdgpu: check memory allocation failure

2017-08-23 Thread Christophe JAILLET
in amdgpu_cs_process_syncobj_out_dep() ---> error code returned by amdgpu_cs_dependencies() --> amdgpu_cs_parser_fini() is called Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgp

Re: [PATCH] mt7601u: check memory allocation failure

2017-08-21 Thread Christophe JAILLET
Le 21/08/2017 à 23:41, Jakub Kicinski a écrit : On Mon, 21 Aug 2017 14:34:30 -0700, Jakub Kicinski wrote: On Mon, 21 Aug 2017 22:59:56 +0200, Christophe JAILLET wrote: Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below Signed-off

Re: [PATCH] mt7601u: check memory allocation failure

2017-08-21 Thread Christophe JAILLET
Le 21/08/2017 à 23:41, Jakub Kicinski a écrit : On Mon, 21 Aug 2017 14:34:30 -0700, Jakub Kicinski wrote: On Mon, 21 Aug 2017 22:59:56 +0200, Christophe JAILLET wrote: Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below Signed-off

[PATCH v2] mt7601u: check memory allocation failure

2017-08-21 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below. As 'dev->tx_q' can be NULL, we also need to check for that in 'mt7601u_free_tx()', and return early. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- v2: avoid ano

[PATCH v2] mt7601u: check memory allocation failure

2017-08-21 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below. As 'dev->tx_q' can be NULL, we also need to check for that in 'mt7601u_free_tx()', and return early. Signed-off-by: Christophe JAILLET --- v2: avoid another NULL pointer derefere

[PATCH] mt7601u: check memory allocation failure

2017-08-21 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/wireless/mediatek/mt7601u/dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wi

[PATCH] mt7601u: check memory allocation failure

2017-08-21 Thread Christophe JAILLET
Check memory allocation failure and return -ENOMEM in such a case, as already done a few lines below Signed-off-by: Christophe JAILLET --- drivers/net/wireless/mediatek/mt7601u/dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net

[PATCH] ieee802154: ca8210: Fix a potential NULL pointer dereference

2017-08-20 Thread Christophe JAILLET
'spi' is known to be NULL, so we dereference a NULL pointer here. Use 'pr_crit()' instead of 'dev_crit()' to report the message. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ieee802154/ca8210.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-)

[PATCH] ieee802154: ca8210: Fix a potential NULL pointer dereference

2017-08-20 Thread Christophe JAILLET
'spi' is known to be NULL, so we dereference a NULL pointer here. Use 'pr_crit()' instead of 'dev_crit()' to report the message. Signed-off-by: Christophe JAILLET --- drivers/net/ieee802154/ca8210.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ieee802154

[PATCH 2/2] soc/fsl/qe: Slighly simplify code

2017-08-20 Thread Christophe JAILLET
Return 0 instead of 'ret' (which is 0 at this point) to make the code more explicit. Also avoid a useless initialization of 'ret'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/soc/fsl/qe/qe_tdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

<    4   5   6   7   8   9   10   11   12   13   >