[PATCH] staging: rtl8723bs: Fix the return value in case of error in 'rtw_wx_read32()'

2018-10-17 Thread Christophe JAILLET
We return 0 unconditionally in 'rtw_wx_read32()'. However, 'ret' is set to some error codes in several error handling paths. Return 'ret' instead to propagate the error code. Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver") Signed-off-by:

Re: [PATCH] staging: wfx: make a const array static, makes object smaller

2020-10-19 Thread Christophe JAILLET
Le 17/10/2020 à 02:11, Joe Perches a écrit : On Fri, 2020-10-16 at 23:33 +0100, Colin King wrote: From: Colin Ian King Don't populate const array filter_ies on the stack but instead make it static. Makes the object code smaller by 261 bytes. Before: text data bss dec

[PATCH] vme: switch from 'pci_' to 'dma_' API

2020-12-05 Thread Christophe JAILLET
e2) +dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ -pci_set_dma_mask(e1, e2) +dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ -pci_set_consistent_dma_mask(e1, e2) +dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET ---

[PATCH] staging: spmi: hisi-spmi-controller: Fix some error handling paths

2020-12-13 Thread Christophe JAILLET
rror message (s/spmi_add_controller/spmi_controller_add/) Signed-off-by: Christophe JAILLET --- .../staging/hikey9xx/hisi-spmi-controller.c | 21 +-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/staging/hikey9xx/hisi-spmi-controller.c b/drivers/staging/hi

[PATCH] staging: mt7621-dma: Fix a resource leak in an error handling path

2020-12-13 Thread Christophe JAILLET
If an error occurs after calling 'mtk_hsdma_init()', it must be undone by a corresponding call to 'mtk_hsdma_uninit()' as already done in the remove function. Fixes: 0853c7a53eb3 ("staging: mt7621-dma: ralink: add rt2880 dma engine") Signed-off-by: Christophe JAILLE

[PATCH] staging: rtl8712: Improve naming of include hearder guards

2019-08-18 Thread Christophe JAILLET
Choose a better name for the include hearder guard used in rtl871x_io.h. '_IO_H_' is to generic and does not match the comment after the #endif. Use '_RTL871X_IO_H_' instead. Also make the comments in the #endif /* XXX */ match the name used in #ifndef. Signed-off-by

[PATCH] staging: wfx: Fix a memory leak in 'wfx_upload_beacon'

2019-11-01 Thread Christophe JAILLET
The current code is a no-op, because all it can do is 'dev_kfree_skb(NULL)' Revert the test to free skb, if not NULL. Signed-off-by: Christophe JAILLET --- This patch is purely speculative. The 'if (...)' could also be removed completely if we refactor the code and re

[PATCH v2] staging: wfx: Fix a memory leak in 'wfx_upload_beacon'

2019-11-02 Thread Christophe JAILLET
The current code is a no-op, because all it can do is 'dev_kfree_skb(NULL)' Remove the test before 'dev_kfree_skb()' Signed-off-by: Christophe JAILLET --- V2: remove the 'if(...)', 'dev_kfree_skb()' can handle NULL. --- drivers/staging/wfx/sta.c |

[PATCH] staging: bcm2835-camera: Avoid apotential sleep while holding a spin_lock

2019-06-23 Thread Christophe JAILLET
Do not allocate memory with GFP_KERNEL when holding a spin_lock, it may sleep. Use GFP_NOWAIT instead. Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.") Signed-off-by: Christophe JAILLET --- drivers/staging/vc04_services/bcm2835-camera/mmal-v

[PATCH] staging: unisys: visornic: Update the description of 'poll_for_irq()'

2019-07-21 Thread Christophe JAILLET
Commit e99e88a9d2b06 ("treewide: setup_timer() -> timer_setup()") has updated the parameters of 'poll_for_irq()' but not the comment above the function. Update the comment and fix a typo. s/visronic/visornic/ Signed-off-by: Christophe JAILLET --- drivers/staging/unisys/v

[PATCH] Staging: fbtft: Fix some typo. pdc8544 --> pcd8544

2019-07-25 Thread Christophe JAILLET
The driver is related to 'pcd8544'. However, 2 strings are about pdc8544 (c and d switched) Fix it. Signed-off-by: Christophe JAILLET --- This patch is only theorical. It is based on the fact that a part of the filename (i.e. pcd8544) looks misspelled in the file itself. I don&

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

2017-09-22 Thread Christophe JAILLET
The calling graph 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/r8192

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

2017-09-22 Thread Christophe JAILLET
d error handling code from 'rtl8192_ini()'. All this resources freeing 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 compi

[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 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 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 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 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] staging: lustre: Fix an error handling path in 'client_common_fill_super()'

2018-05-11 Thread Christophe JAILLET
According to error handling path before and after this one, we should go to 'out_md_fid' here, instead of 'out_md', if 'obd_connect()' fails. Signed-off-by: Christophe JAILLET --- The last goto 'out_lock_cn_cb' looks spurious but is correct. In case of

[PATCH] staging: lustre: Use 'kvfree()' for memory allocated by 'kvzalloc()'

2018-05-12 Thread Christophe JAILLET
'buf' is allocated with 'kvzalloc()'. 'kvfree()' must be used to free it. Signed-off-by: Christophe JAILLET --- drivers/staging/lustre/lustre/obdclass/llog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdc

[PATCH 1/2] staging: unisys: Use kzalloc instead of kmalloc/memset

2015-07-13 Thread Christophe JAILLET
This patch turns a kmalloc/memset into an equivalent kzalloc. Signed-off-by: Christophe JAILLET --- drivers/staging/unisys/visorbus/visorbus_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys

[PATCH 2/2] staging: unisys: Reduce indent

2015-07-13 Thread Christophe JAILLET
Remove some extra tabs in order to improve readalibility. Signed-off-by: Christophe JAILLET --- drivers/staging/unisys/visorbus/visorbus_main.c | 49 - 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b

[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 1/2] staging: lustre: obdclass: Fix error handling

2016-11-06 Thread Christophe JAILLET
'lustre_cfg_new()' does not return NULL but ERR_PTR(-ENOMEM) So IS_ERR should be used to check the return value. Signed-off-by: Christophe JAILLET --- drivers/staging/lustre/lustre/obdclass/obd_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 2/2] staging: lustre: obdclass: Add handling of error returned by lustre_cfg_new

2016-11-06 Thread Christophe JAILLET
'lustre_cfg_new()' can return ERR_PTR(-ENOMEM). Handle these errors and propagate the error code to the callers. Error handling has been rearranged in 'lustre_process_log()' with the addition of a label in order to free some resources. Signed-off-by: Christophe JAILLET

[PATCH] staging: iio: ad9832:

2016-11-19 Thread Christophe JAILLET
ing in order to allocate memory and have 'st' be a valid pointer before using it. Fixes: a98461d79ba5 ("staging: iio: ad9832: add DVDD regulator") Fixes: 43a07e48af44 ("staging: iio: ad9832: clean-up regulator 'reg'") Signed-off-by: Christophe J

[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] staging: vme: vme_user: Fix some error handling paths in 'vme_user_probe()'

2018-03-13 Thread Christophe JAILLET
2 gotos in error handling paths branch to the wrong label. Fix it. Signed-off-by: Christophe JAILLET --- drivers/staging/vme/devices/vme_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices

Re: [PATCH] staging: wilc1000: replace kmalloc + memcpy with kmemdup

2018-03-26 Thread Christophe Jaillet
Le 26/03/2018 à 19:16, Colin King a écrit : From: Colin Ian King Replace several allocation and memcpys with kmemdup and add in some missing memory allocation failure checks. Also fix an incorrect -EFAULT return with -ENOMEM. Signed-off-by: Colin Ian King --- drivers/staging/wilc1000/host_

Re: [PATCH] staging: comedi: s626: Remove pci-dma-compat wrapper APIs.

2020-07-11 Thread Christophe JAILLET
Le 11/07/2020 à 14:35, Suraj Upadhyay a écrit : The legacy API wrappers in include/linux/pci-dma-compat.h should go away as it creates unnecessary midlayering for include/linux/dma-mapping.h APIs, instead use dma-mapping.h APIs directly. The patch has been generated with the coccinelle script be

[PATCH] staging: ks7010: Do not use GFP_KERNEL in atomic context

2020-08-09 Thread Christophe JAILLET
evice_ops structure). Such calls are guarded by the __netif_tx_lock spinlock. So memory allocation must be atomic. So, use GFP_ATOMIC instead of GFP_KERNEL 'in michael_mic()' Fixes: ??? Signed-off-by: Christophe JAILLET --- This is completely speculative. I don't know if the

[PATCH] staging: rtl8192u: Do not use GFP_KERNEL in atomic context

2020-08-13 Thread Christophe JAILLET
fix large frame size compiler warning") Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx

[PATCH] media: staging/intel-ipu3: css: Correctly reset some memory

2020-08-22 Thread Christophe JAILLET
The intent here is to reset the whole 'scaler_coeffs_luma' array, not just the first element. Fixes: e0a5b744 ("media: staging/intel-ipu3: css: Compute and program ccs") Signed-off-by: Christophe JAILLET --- drivers/staging/media/ipu3/ipu3-css-params.c | 2 +- 1 file