[PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()'

2018-03-18 Thread Christophe JAILLET
I've splitted these fixes into 2 patches becasue they do not fixe the same commit. Christophe JAILLET (2): drm/sun4i: hdmi: Fix an error handling path in 'sun4i_hdmi_bind()' drm/sun4i: hdmi: Fix another error handling path in 'sun4i_hdmi_bind()' drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c

Re: [PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

2018-03-16 Thread Christophe JAILLET
Le 16/03/2018 à 20:27, David Miller a écrit : From: Christophe JAILLET <christophe.jail...@wanadoo.fr> Date: Wed, 14 Mar 2018 22:09:34 +0100 diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c index 16f9bee992fe..8ee9dfd0e363 100644 --- a/d

Re: [PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

2018-03-16 Thread Christophe JAILLET
Le 16/03/2018 à 20:27, David Miller a écrit : From: Christophe JAILLET Date: Wed, 14 Mar 2018 22:09:34 +0100 diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c index 16f9bee992fe..8ee9dfd0e363 100644 --- a/drivers/net/ethernet/arc/emac_rockchip.c

Re: [PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

2018-03-16 Thread Christophe JAILLET
Le 16/03/2018 à 20:27, David Miller a écrit : From: Christophe JAILLET <christophe.jail...@wanadoo.fr> Date: Wed, 14 Mar 2018 22:09:34 +0100 diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c index 16f9bee992fe..8ee9dfd0e363 100644 --- a/d

Re: [PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

2018-03-16 Thread Christophe JAILLET
Le 16/03/2018 à 20:27, David Miller a écrit : From: Christophe JAILLET Date: Wed, 14 Mar 2018 22:09:34 +0100 diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c index 16f9bee992fe..8ee9dfd0e363 100644 --- a/drivers/net/ethernet/arc/emac_rockchip.c

[PATCH] mfd: pcf50633: Fix some memory leaks in the error handling path of 'pcf50633_probe()'

2018-03-14 Thread Christophe JAILLET
If a 'platform_device_alloc()' call fails, we still need to release the resources that have already been allocated before returning. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/mfd/pcf50633-core.c | 7 +-- 1 file changed, 5 insertions(+), 2 del

[PATCH] mfd: pcf50633: Fix some memory leaks in the error handling path of 'pcf50633_probe()'

2018-03-14 Thread Christophe JAILLET
If a 'platform_device_alloc()' call fails, we still need to release the resources that have already been allocated before returning. Signed-off-by: Christophe JAILLET --- drivers/mfd/pcf50633-core.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/pcf50633

[PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

2018-03-14 Thread Christophe JAILLET
If the optional regulator is deferrred, we must release some resources. They will be re-allocated when the probe function will be called again. Fixes: 6eacf31139bf ("ethernet: arc: Add support for Rockchip SoC layer device tree bindings") Signed-off-by: Christophe JAILLET <ch

[PATCH] net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

2018-03-14 Thread Christophe JAILLET
If the optional regulator is deferrred, we must release some resources. They will be re-allocated when the probe function will be called again. Fixes: 6eacf31139bf ("ethernet: arc: Add support for Rockchip SoC layer device tree bindings") Signed-off-by: Christophe JAILLET --- d

[PATCH 2/3] remoteproc: imx_rproc: Re-use existing error handling path in 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
Avoid some code ducplication and be more future-proof. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/remoteproc/imx_rproc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_r

[PATCH 2/3] remoteproc: imx_rproc: Re-use existing error handling path in 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
Avoid some code ducplication and be more future-proof. Signed-off-by: Christophe JAILLET --- drivers/remoteproc/imx_rproc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 05bcbce2013a..6d02ef62a626

[PATCH 1/3] remoteproc: imx_rproc: Fix an error handling path in 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
If 'of_device_get_match_data()' fails, we must undo the previous 'rproc_alloc()' call. Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/remoteproc/imx_rproc.c |

[PATCH 1/3] remoteproc: imx_rproc: Fix an error handling path in 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
If 'of_device_get_match_data()' fails, we must undo the previous 'rproc_alloc()' call. Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver") Signed-off-by: Christophe JAILLET --- drivers/remoteproc/imx_rproc.c | 6 -- 1 file changed, 4 insert

[PATCH 3/3] remoteproc: imx_rproc: Slightly simplify code in 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
We can return directly at the beginning of the function and save the 'err' label. We can also explicitly return 0 when the probe succeed. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/remoteproc/imx_rproc.c | 10 -- 1 file changed, 4 insertions

[PATCH 3/3] remoteproc: imx_rproc: Slightly simplify code in 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
We can return directly at the beginning of the function and save the 'err' label. We can also explicitly return 0 when the probe succeed. Signed-off-by: Christophe JAILLET --- drivers/remoteproc/imx_rproc.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH 0/3] remoteproc: imx_rproc: Improve 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
Patch 1 fixes a bug. Patches 2 and 3 are just clean-ups. Christophe JAILLET (3): remoteproc: imx_rproc: Fix an error handling path in 'imx_rproc_probe()' remoteproc: imx_rproc: Re-use existing error handling path in 'imx_rproc_probe()' remoteproc: imx_rproc: Slightly simplify code

[PATCH 0/3] remoteproc: imx_rproc: Improve 'imx_rproc_probe()'

2018-03-14 Thread Christophe JAILLET
Patch 1 fixes a bug. Patches 2 and 3 are just clean-ups. Christophe JAILLET (3): remoteproc: imx_rproc: Fix an error handling path in 'imx_rproc_probe()' remoteproc: imx_rproc: Re-use existing error handling path in 'imx_rproc_probe()' remoteproc: imx_rproc: Slightly simplify code

[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 <christophe.jail...@wanadoo.fr> --- drivers/staging/vme/devices/vme_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vme/devices/vme_use

[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

[PATCH] regulator: gpio: Fix some error handling paths in 'gpio_regulator_probe()'

2018-03-13 Thread Christophe JAILLET
Re-order error handling code and gotos to avoid leaks in error handling paths. Fixes: 9f946099fe19 ("regulator: gpio: fix parsing of gpio list") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/regulator/gpio-regulator.c | 16 +++- 1

[PATCH] regulator: gpio: Fix some error handling paths in 'gpio_regulator_probe()'

2018-03-13 Thread Christophe JAILLET
Re-order error handling code and gotos to avoid leaks in error handling paths. Fixes: 9f946099fe19 ("regulator: gpio: fix parsing of gpio list") Signed-off-by: Christophe JAILLET --- drivers/regulator/gpio-regulator.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletion

[PATCH] spi: bcm-qspi: fIX some error handling paths

2018-03-13 Thread Christophe JAILLET
For some reason, commit c0368e4db4a3 ("spi: bcm-qspi: Fix use after free in bcm_qspi_probe() in error path") has updated some gotos, but not all of them. This looks spurious, so fix it. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by

[PATCH] spi: bcm-qspi: fIX some error handling paths

2018-03-13 Thread Christophe JAILLET
For some reason, commit c0368e4db4a3 ("spi: bcm-qspi: Fix use after free in bcm_qspi_probe() in error path") has updated some gotos, but not all of them. This looks spurious, so fix it. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by: Christop

[PATCH 1/3] drm/meson: Fix an un-handled error path in 'meson_drv_bind_master()'

2018-03-12 Thread Christophe JAILLET
'drm_vblank_init()' can fail. So handle this (unlikely) error. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/gpu/drm/meson/meson_drv.c | 5 - 1 file changed, 4

[PATCH 3/3] drm/meson: Fix some error handling paths in 'meson_drv_bind_master()'

2018-03-12 Thread Christophe JAILLET
If one of these functions fail, we whould free 'drm', as alreadry done in the other error handling paths, below and above. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drive

[PATCH 1/3] drm/meson: Fix an un-handled error path in 'meson_drv_bind_master()'

2018-03-12 Thread Christophe JAILLET
'drm_vblank_init()' can fail. So handle this (unlikely) error. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/meson/meson_drv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH 3/3] drm/meson: Fix some error handling paths in 'meson_drv_bind_master()'

2018-03-12 Thread Christophe JAILLET
If one of these functions fail, we whould free 'drm', as alreadry done in the other error handling paths, below and above. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/meson/meson_

[PATCH 2/3] drm/meson: Use drm_dev_put() instead of drm_dev_unref()

2018-03-12 Thread Christophe JAILLET
According to 'drivers/gpu/drm/drm_drv.c', 'drm_dev_unref()' is just a compatibility alias for 'drm_dev_put()'. So use the latter instead. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/gpu/drm/meson/meson_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH 2/3] drm/meson: Use drm_dev_put() instead of drm_dev_unref()

2018-03-12 Thread Christophe JAILLET
According to 'drivers/gpu/drm/drm_drv.c', 'drm_dev_unref()' is just a compatibility alias for 'drm_dev_put()'. So use the latter instead. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/meson/meson_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu

[PATCH 0/3] Fix some error handling paths in 'meson_drv_bind_master()'

2018-03-12 Thread Christophe JAILLET
Patch 1 and 3 are fixes. Patch 2 is just a kind of clean-up noticed while patching this driver. If patch 2 is considered as useless, patch 3 can be applied on top of patch 1, it does nor depend on the 2nd patch. Christophe JAILLET (3): drm/meson: Fix an un-handled error path

[PATCH 0/3] Fix some error handling paths in 'meson_drv_bind_master()'

2018-03-12 Thread Christophe JAILLET
Patch 1 and 3 are fixes. Patch 2 is just a kind of clean-up noticed while patching this driver. If patch 2 is considered as useless, patch 3 can be applied on top of patch 1, it does nor depend on the 2nd patch. Christophe JAILLET (3): drm/meson: Fix an un-handled error path

Re: [PATCH] net/mlx4_en: Fix a memory leak in case of error in 'mlx4_en_init_netdev()'

2018-03-12 Thread Christophe Jaillet
Le 12/03/2018 à 09:42, Tariq Toukan a écrit : > > > On 12/03/2018 12:45 AM, Christophe JAILLET wrote: >> If 'kzalloc' fails, we must free some memory before returning. >> >> Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings >> scheme&

Re: [PATCH] net/mlx4_en: Fix a memory leak in case of error in 'mlx4_en_init_netdev()'

2018-03-12 Thread Christophe Jaillet
Le 12/03/2018 à 09:42, Tariq Toukan a écrit : > > > On 12/03/2018 12:45 AM, Christophe JAILLET wrote: >> If 'kzalloc' fails, we must free some memory before returning. >> >> Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings >> scheme&

[PATCH] drm/sun4i: Fix an error handling path in 'sun4i_drv_bind()'

2018-03-11 Thread Christophe JAILLET
correct number of crtcs") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 4570da0

[PATCH] drm/sun4i: Fix an error handling path in 'sun4i_drv_bind()'

2018-03-11 Thread Christophe JAILLET
correct number of crtcs") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 4570da0227b4..d9a71f361b14 100644 --- a/d

[PATCH] net/mlx4_en: Fix a memory leak in case of error in 'mlx4_en_init_netdev()'

2018-03-11 Thread Christophe JAILLET
If 'kzalloc' fails, we must free some memory before returning. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 file chan

[PATCH] net/mlx4_en: Fix a memory leak in case of error in 'mlx4_en_init_netdev()'

2018-03-11 Thread Christophe JAILLET
If 'kzalloc' fails, we must free some memory before returning. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] drm: zte: Fix an error handling path in 'zx_crtc_bind()'

2018-03-11 Thread Christophe JAILLET
'ret' is known to be 0 at this point. It must be updated by the value returned by 'clk_prepare_enable()'. Fixes: 0a886f59528a ("drm: zte: add initial vou drm driver") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/gpu/drm/zte/zx_vou.c | 2 +- 1

[PATCH] drm: zte: Fix an error handling path in 'zx_crtc_bind()'

2018-03-11 Thread Christophe JAILLET
'ret' is known to be 0 at this point. It must be updated by the value returned by 'clk_prepare_enable()'. Fixes: 0a886f59528a ("drm: zte: add initial vou drm driver") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/zte/zx_vou.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH 0/4] usb: gadget: fotg210-udc: Fixes and cleanup

2018-02-12 Thread Christophe Jaillet
Le 12/02/2018 à 09:48, Felipe Balbi a écrit : Hi, Christophe JAILLET <christophe.jail...@wanadoo.fr> writes: This serie aims to fix 2 issues. (path 2 & 4) The 2nd patch fixes a memory leak. It uses devm_ function a simplify the handling of the memory. The 4th patch fixes a potenti

Re: [PATCH 0/4] usb: gadget: fotg210-udc: Fixes and cleanup

2018-02-12 Thread Christophe Jaillet
Le 12/02/2018 à 09:48, Felipe Balbi a écrit : Hi, Christophe JAILLET writes: This serie aims to fix 2 issues. (path 2 & 4) The 2nd patch fixes a memory leak. It uses devm_ function a simplify the handling of the memory. The 4th patch fixes a potential invalid pointer dereference. T

[PATCH] cxgb4: Fix error handling path in 'init_one()'

2018-02-06 Thread Christophe JAILLET
Commit baf5086840ab1 ("cxgb4: restructure VF mgmt code") has reordered some code but an error handling label has not been updated accordingly. So fix it and free 'adapter' if 't4_wait_dev_ready()' fails. Fixes: baf5086840ab1 ("cxgb4: restructure VF mgmt code") Signed-off-by

[PATCH] cxgb4: Fix error handling path in 'init_one()'

2018-02-06 Thread Christophe JAILLET
Commit baf5086840ab1 ("cxgb4: restructure VF mgmt code") has reordered some code but an error handling label has not been updated accordingly. So fix it and free 'adapter' if 't4_wait_dev_ready()' fails. Fixes: baf5086840ab1 ("cxgb4: restructure VF mgmt code") Signed-off-by

[PATCH] igb: Fix a test with HWTSTAMP_TX_ON

2018-02-06 Thread Christophe JAILLET
hwtstamp_config' in 'include/uapi/linux/net_tstamp.h' This fixes a warning reported by smatch: igb_xmit_frame_ring() warn: bit shifter 'HWTSTAMP_TX_ON' used for logical '&' Fixes: 26bd4e2db06be ("igb: protect TX timestamping from API misuse") Signed-off-by: Christophe JAILLET &l

[PATCH] igb: Fix a test with HWTSTAMP_TX_ON

2018-02-06 Thread Christophe JAILLET
hwtstamp_config' in 'include/uapi/linux/net_tstamp.h' This fixes a warning reported by smatch: igb_xmit_frame_ring() warn: bit shifter 'HWTSTAMP_TX_ON' used for logical '&' Fixes: 26bd4e2db06be ("igb: protect TX timestamping from API misuse") Signed-off-by: Christophe JAILLET --- driver

[PATCH] regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()'

2018-01-26 Thread Christophe JAILLET
If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must release the reference on the current 'child' node before returning. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/regulator/of_regulator.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] regulator: of: Add a missing 'of_node_put()' in an error handling path of 'of_regulator_match()'

2018-01-26 Thread Christophe JAILLET
If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must release the reference on the current 'child' node before returning. Signed-off-by: Christophe JAILLET --- drivers/regulator/of_regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator

[PATCH] spi: sprd: Use 'spi_master_put()' instead of 'spi_controller_put()'

2018-01-26 Thread Christophe JAILLET
'spi_alloc_master()' calls should be balanced by a 'spi_master_put()' call. 'spi_controller_put()' is equivalent (see include/linux/spi/spi.h) but it is cleaner and more logical to use 'spi_master_put()'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/spi/sp

[PATCH] spi: sprd: Use 'spi_master_put()' instead of 'spi_controller_put()'

2018-01-26 Thread Christophe JAILLET
'spi_alloc_master()' calls should be balanced by a 'spi_master_put()' call. 'spi_controller_put()' is equivalent (see include/linux/spi/spi.h) but it is cleaner and more logical to use 'spi_master_put()'. Signed-off-by: Christophe JAILLET --- drivers/spi/spi-sprd-adi.c | 2 +- 1 file changed

[PATCH] spi: orion: Fix a resource leak if the optional "axi" clk is deferred

2018-01-25 Thread Christophe JAILLET
ed. Fixes: 92ae112e477a ("spi: orion: Fix clock resource by adding an optional bus clock") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/spi/spi-orion.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi

[PATCH] spi: orion: Fix a resource leak if the optional "axi" clk is deferred

2018-01-25 Thread Christophe JAILLET
ed. Fixes: 92ae112e477a ("spi: orion: Fix clock resource by adding an optional bus clock") Signed-off-by: Christophe JAILLET --- drivers/spi/spi-orion.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.

[PATCH] scsi: 3ware: use pci_iounmap instead of iounmap

2018-01-19 Thread Christophe JAILLET
'base_addr' has been mapped using 'pci_iomap()'. It should be freed with the corresponding 'pci_iounmap()' instead of 'iomap()'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/3w-sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] scsi: 3ware: use pci_iounmap instead of iounmap

2018-01-19 Thread Christophe JAILLET
'base_addr' has been mapped using 'pci_iomap()'. It should be freed with the corresponding 'pci_iounmap()' instead of 'iomap()'. Signed-off-by: Christophe JAILLET --- drivers/scsi/3w-sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/3w-sas.c b/drivers

Re: [PATCH] EDAC, mv64x60: Remove some code duplication

2018-01-15 Thread Christophe JAILLET
Le 15/01/2018 à 23:31, Michael Ellerman a écrit : Chris Packham <chris.pack...@alliedtelesis.co.nz> writes: On 14/01/18 06:17, Christophe JAILLET wrote: Le 13/01/2018 à 15:22, Borislav Petkov a écrit : + Chris Packham who's been fixing some stuff in here too. On Sat, Jan 13, 2018 at

Re: [PATCH] EDAC, mv64x60: Remove some code duplication

2018-01-15 Thread Christophe JAILLET
Le 15/01/2018 à 23:31, Michael Ellerman a écrit : Chris Packham writes: On 14/01/18 06:17, Christophe JAILLET wrote: Le 13/01/2018 à 15:22, Borislav Petkov a écrit : + Chris Packham who's been fixing some stuff in here too. On Sat, Jan 13, 2018 at 08:28:21AM +0100, Christophe JAILLET wrote

Re: [PATCH] EDAC, mv64x60: Remove some code duplication

2018-01-13 Thread Christophe JAILLET
Le 13/01/2018 à 15:22, Borislav Petkov a écrit : + Chris Packham who's been fixing some stuff in here too. On Sat, Jan 13, 2018 at 08:28:21AM +0100, Christophe JAILLET wrote: Reorder the error handling code in order to release the resources in reverse order than allocation. Introduce a new

Re: [PATCH] EDAC, mv64x60: Remove some code duplication

2018-01-13 Thread Christophe JAILLET
Le 13/01/2018 à 15:22, Borislav Petkov a écrit : + Chris Packham who's been fixing some stuff in here too. On Sat, Jan 13, 2018 at 08:28:21AM +0100, Christophe JAILLET wrote: Reorder the error handling code in order to release the resources in reverse order than allocation. Introduce a new

[PATCH] mtd: onenand: samsung: remove incorrect __iomem annotation

2018-01-13 Thread Christophe JAILLET
'page_buf' and 'oob_buf' are allocated with 'devm_kzalloc()' and should not have __iommem decoration. Remove these decorations and some useless casting. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/mtd/onenand/samsung.c | 12 ++-- 1 file chan

[PATCH] mtd: onenand: samsung: remove incorrect __iomem annotation

2018-01-13 Thread Christophe JAILLET
'page_buf' and 'oob_buf' are allocated with 'devm_kzalloc()' and should not have __iommem decoration. Remove these decorations and some useless casting. Signed-off-by: Christophe JAILLET --- drivers/mtd/onenand/samsung.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[PATCH] EDAC, mv64x60: Remove some code duplication

2018-01-12 Thread Christophe JAILLET
Reorder the error handling code in order to release the resources in reverse order than allocation. Introduce a new 'release_group' label in the error handling path and use it to void some code duplication. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- driver

[PATCH] EDAC, mv64x60: Remove some code duplication

2018-01-12 Thread Christophe JAILLET
Reorder the error handling code in order to release the resources in reverse order than allocation. Introduce a new 'release_group' label in the error handling path and use it to void some code duplication. Signed-off-by: Christophe JAILLET --- drivers/edac/mv64x60_edac.c | 7 --- 1 file

[PATCH 2/4] usb: gadget: fotg210-udc: Fix a memory leak

2018-01-12 Thread Christophe JAILLET
The memory referenced by the 'fotg210->ep[]' array, is never freed. So there is a memory leak in the error handling path of the probe function and when the driver is unloaded. Use 'devm_kzalloc()' to fix these leaks. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> ---

[PATCH 1/4] usb: gadget: fotg210-udc: Remove a useless

2018-01-12 Thread Christophe JAILLET
There is no need to use an intermediate array for these memory allocations, so, axe it. While at it, turn a '== NULL' into a shorter '!' when testing memory allocation failure. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/usb/gadget/udc/fotg210-udc

[PATCH 2/4] usb: gadget: fotg210-udc: Fix a memory leak

2018-01-12 Thread Christophe JAILLET
The memory referenced by the 'fotg210->ep[]' array, is never freed. So there is a memory leak in the error handling path of the probe function and when the driver is unloaded. Use 'devm_kzalloc()' to fix these leaks. Signed-off-by: Christophe JAILLET --- drivers/usb/gadget/udc/fotg210-udc.c

[PATCH 1/4] usb: gadget: fotg210-udc: Remove a useless

2018-01-12 Thread Christophe JAILLET
There is no need to use an intermediate array for these memory allocations, so, axe it. While at it, turn a '== NULL' into a shorter '!' when testing memory allocation failure. Signed-off-by: Christophe JAILLET --- drivers/usb/gadget/udc/fotg210-udc.c | 6 ++ 1 file changed, 2 insertions

[PATCH 4/4] usb: gadget: fotg210-udc: Fix a potential invalid pointer dereference

2018-01-12 Thread Christophe JAILLET
code. (In fact, this change should be a no-op, because 'req' is the first field of 'struct fotg210_request'. So passing NULL would result in 'free(NULL)' in 'fotg210_ep_free_request()'. Anyway avoiding the goto is cleaner.) Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo

[PATCH 4/4] usb: gadget: fotg210-udc: Fix a potential invalid pointer dereference

2018-01-12 Thread Christophe JAILLET
code. (In fact, this change should be a no-op, because 'req' is the first field of 'struct fotg210_request'. So passing NULL would result in 'free(NULL)' in 'fotg210_ep_free_request()'. Anyway avoiding the goto is cleaner.) Signed-off-by: Christophe JAILLET --- drivers/usb/gadget/udc/fotg210

[PATCH 3/4] usb: gadget: fotg210-udc: Simplify code

2018-01-12 Thread Christophe JAILLET
Use 'devm_kzalloc()' and 'devm_ioremap()' to simplify code. While at it, turn some '== NULL' into shorter '!' when testing memory allocation failure. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/usb/gadget/udc/fotg210-udc.c | 25 -

[PATCH 3/4] usb: gadget: fotg210-udc: Simplify code

2018-01-12 Thread Christophe JAILLET
Use 'devm_kzalloc()' and 'devm_ioremap()' to simplify code. While at it, turn some '== NULL' into shorter '!' when testing memory allocation failure. Signed-off-by: Christophe JAILLET --- drivers/usb/gadget/udc/fotg210-udc.c | 25 - 1 file changed, 8 insertions(+), 17

[PATCH 0/4] usb: gadget: fotg210-udc: Fixes and cleanup

2018-01-12 Thread Christophe JAILLET
evm_ function to simplify code. I've left the request_irq/free_irq because I'm unsure of potential side effects if some other resources are freed while an IRQ can still be triggered. So I've preferred to leave it as-is. Christophe JAILLET (4): usb: gadget: fotg210-udc: Remove a useless usb: ga

[PATCH 0/4] usb: gadget: fotg210-udc: Fixes and cleanup

2018-01-12 Thread Christophe JAILLET
evm_ function to simplify code. I've left the request_irq/free_irq because I'm unsure of potential side effects if some other resources are freed while an IRQ can still be triggered. So I've preferred to leave it as-is. Christophe JAILLET (4): usb: gadget: fotg210-udc: Remove a useless usb: ga

[PATCH] iio: adc: aspeed: Fix error handling path

2018-01-07 Thread Christophe JAILLET
The labels and branching order of the error path of 'aspeed_adc_probe()' are broken. Re-order the labels and goto statements. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Not sure where it comes from. Merge conflict incorrectly fixed? --- drivers/iio/adc/aspeed_adc

[PATCH] iio: adc: aspeed: Fix error handling path

2018-01-07 Thread Christophe JAILLET
The labels and branching order of the error path of 'aspeed_adc_probe()' are broken. Re-order the labels and goto statements. Signed-off-by: Christophe JAILLET --- Not sure where it comes from. Merge conflict incorrectly fixed? --- drivers/iio/adc/aspeed_adc.c | 7 --- 1 file changed, 4

[PATCH] EDAC, mv64x60: Fix an error handling path

2018-01-07 Thread Christophe JAILLET
We should not call 'edac_mc_del_mc()' if a corresponding call to 'edac_mc_add_mc()' has not been performed yet. So here, we should go to err instead of err2 to branch at the right place of the error handling path. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- d

[PATCH] EDAC, mv64x60: Fix an error handling path

2018-01-07 Thread Christophe JAILLET
We should not call 'edac_mc_del_mc()' if a corresponding call to 'edac_mc_add_mc()' has not been performed yet. So here, we should go to err instead of err2 to branch at the right place of the error handling path. Signed-off-by: Christophe JAILLET --- drivers/edac/mv64x60_edac.c | 2 +- 1 file

[PATCH] NFSv4.1: Ensure 'nfs4_sp4_select_mode()' can report -EINVAL when needed

2018-01-07 Thread Christophe JAILLET
flags in nfs4_sp4_select_mode()") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Untested and not sure at all if correct... --- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 17a03f2c4330..ae0

[PATCH] NFSv4.1: Ensure 'nfs4_sp4_select_mode()' can report -EINVAL when needed

2018-01-07 Thread Christophe JAILLET
flags in nfs4_sp4_select_mode()") Signed-off-by: Christophe JAILLET --- Untested and not sure at all if correct... --- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 17a03f2c4330..ae00ac59f59b 100644 --- a/fs/nfs/nfs4proc.

[PATCH 2/2] ASoC: Intel: sst: Fix some style

2018-01-06 Thread Christophe JAILLET
This patch fixes 3 small issues: - missing 2nd '*' at the beginning of a doxygen comment - extra space after a '\n' in a dev_dbg message - extra tab before a 'return" statement Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- sound/soc/intel/atom/sst/sst_s

[PATCH 2/2] ASoC: Intel: sst: Fix some style

2018-01-06 Thread Christophe JAILLET
This patch fixes 3 small issues: - missing 2nd '*' at the beginning of a doxygen comment - extra space after a '\n' in a dev_dbg message - extra tab before a 'return" statement Signed-off-by: Christophe JAILLET --- sound/soc/intel/atom/sst/sst_stream.c | 6 +++--- 1 file chang

[PATCH 1/2] ASoC: Intel: sst: Fix the return value of 'sst_send_byte_stream_mrfld()'

2018-01-06 Thread Christophe JAILLET
In some error handling paths, an error code is assiegned to 'ret'. However, the function always return 0. Fix it and return the error code if such an error paths is taken. Fixes: 3d9ff34622ba ("ASoC: Intel: sst: add stream operations") Signed-off-by: Christophe JAILLET <ch

[PATCH 1/2] ASoC: Intel: sst: Fix the return value of 'sst_send_byte_stream_mrfld()'

2018-01-06 Thread Christophe JAILLET
In some error handling paths, an error code is assiegned to 'ret'. However, the function always return 0. Fix it and return the error code if such an error paths is taken. Fixes: 3d9ff34622ba ("ASoC: Intel: sst: add stream operations") Signed-off-by: Christophe JAILLET --- sound/soc/

[PATCH] mdio-sun4i: Fix a memory leak

2018-01-06 Thread Christophe JAILLET
If the probing of the regulator is deferred, the memory allocated by 'mdiobus_alloc_size()' will be leaking. It should be freed before the next call to 'sun4i_mdio_probe()' which will reallocate it. Fixes: 4bdcb1dd9feb ("net: Add MDIO bus driver for the Allwinner EMAC") Signed-off-by:

[PATCH] mdio-sun4i: Fix a memory leak

2018-01-06 Thread Christophe JAILLET
If the probing of the regulator is deferred, the memory allocated by 'mdiobus_alloc_size()' will be leaking. It should be freed before the next call to 'sun4i_mdio_probe()' which will reallocate it. Fixes: 4bdcb1dd9feb ("net: Add MDIO bus driver for the Allwinner EMAC") Signed-off-by:

[PATCH 2/4 v3] mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails

2017-12-13 Thread Christophe JAILLET
If 'mtd_device_parse_register()' fails, we still return 0 which mean success. Return the error code instead, as done in all the other error handling paths. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Cross-compiled tested-only v2: call 'onenand_release()' t

[PATCH 2/4 v3] mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails

2017-12-13 Thread Christophe JAILLET
If 'mtd_device_parse_register()' fails, we still return 0 which mean success. Return the error code instead, as done in all the other error handling paths. Signed-off-by: Christophe JAILLET --- Cross-compiled tested-only v2: call 'onenand_release()' to undo 'onenand_scan()' v3: no change

[PATCH 3/4 v3] mtd: onenand: samsung: Remove a useless include

2017-12-13 Thread Christophe JAILLET
This include is not needed, so remove it. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Cross-compiled tested-only v3: new patch in the serie --- drivers/mtd/onenand/samsung.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/onenand/samsung.c b/d

[PATCH 3/4 v3] mtd: onenand: samsung: Remove a useless include

2017-12-13 Thread Christophe JAILLET
This include is not needed, so remove it. Signed-off-by: Christophe JAILLET --- Cross-compiled tested-only v3: new patch in the serie --- drivers/mtd/onenand/samsung.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index

[PATCH 3/4 v3] mtd: onenand: samsung: Propagate the error returned by 'onenand_scan()'

2017-12-13 Thread Christophe JAILLET
Propagate the error code returned by 'onenand_scan()' instead of a hard-coded -EFAULT. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Cross-compiled tested-only v3: new patch in the serie --- drivers/mtd/onenand/samsung.c | 5 +++-- 1 file changed, 3 insertions

[PATCH 3/4 v3] mtd: onenand: samsung: Propagate the error returned by 'onenand_scan()'

2017-12-13 Thread Christophe JAILLET
Propagate the error code returned by 'onenand_scan()' instead of a hard-coded -EFAULT. Signed-off-by: Christophe JAILLET --- Cross-compiled tested-only v3: new patch in the serie --- drivers/mtd/onenand/samsung.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 1/4 v3] mtd: onenand: samsung: use devm_ function to simplify code and fix some leaks

2017-12-13 Thread Christophe JAILLET
-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Cross-compiled tested-only v2: use devm_ioremap_resource() v3: fix a bug introduced in v2 --- drivers/mtd/onenand/samsung.c | 164 -- 1 file changed, 29 insertions(+), 135 deletions(-) diff --git a/d

[PATCH 1/4 v3] mtd: onenand: samsung: use devm_ function to simplify code and fix some leaks

2017-12-13 Thread Christophe JAILLET
-by: Christophe JAILLET --- Cross-compiled tested-only v2: use devm_ioremap_resource() v3: fix a bug introduced in v2 --- drivers/mtd/onenand/samsung.c | 164 -- 1 file changed, 29 insertions(+), 135 deletions(-) diff --git a/drivers/mtd/onenand/samsung.c b/drivers

[PATCH 0/4 v3] mtd: onenand: samsung: Simplify code and fix leaks in error handling paths

2017-12-13 Thread Christophe JAILLET
have been cross compile-tested-only. Christophe JAILLET (4): mtd: onenand: samsung: use devm_ function to simplify code and fix some leaks mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails mtd: onenand: samsung: Propagate the error returned

[PATCH 0/4 v3] mtd: onenand: samsung: Simplify code and fix leaks in error handling paths

2017-12-13 Thread Christophe JAILLET
have been cross compile-tested-only. Christophe JAILLET (4): mtd: onenand: samsung: use devm_ function to simplify code and fix some leaks mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails mtd: onenand: samsung: Propagate the error returned

[PATCH v2] mm: Release a semaphore in 'get_vaddr_frames()'

2017-12-11 Thread Christophe JAILLET
A semaphore is acquired before this check, so we must release it before leaving. Fixes: b7f0554a56f2 ("mm: fail get_vaddr_frames() for filesystem-dax mappings") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- -- Untested -- v1 -> v2: 'goto out' instead

[PATCH v2] mm: Release a semaphore in 'get_vaddr_frames()'

2017-12-11 Thread Christophe JAILLET
A semaphore is acquired before this check, so we must release it before leaving. Fixes: b7f0554a56f2 ("mm: fail get_vaddr_frames() for filesystem-dax mappings") Signed-off-by: Christophe JAILLET --- -- Untested -- v1 -> v2: 'goto out' instead of duplicating code --- mm/frame

Re: [PATCH] mm: Release a semaphore in 'get_vaddr_frames()'

2017-12-10 Thread Christophe JAILLET
Le 10/12/2017 à 10:45, Michal Hocko a écrit : On Sat 09-12-17 08:09:41, Christophe JAILLET wrote: A semaphore is acquired before this check, so we must release it before leaving. Fixes: b7f0554a56f2 ("mm: fail get_vaddr_frames() for filesystem-dax mappings") Signed-off-by: Christop

Re: [PATCH] mm: Release a semaphore in 'get_vaddr_frames()'

2017-12-10 Thread Christophe JAILLET
Le 10/12/2017 à 10:45, Michal Hocko a écrit : On Sat 09-12-17 08:09:41, Christophe JAILLET wrote: A semaphore is acquired before this check, so we must release it before leaving. Fixes: b7f0554a56f2 ("mm: fail get_vaddr_frames() for filesystem-dax mappings") Signed-off-by: Christop

[PATCH 2/2 v2] mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails

2017-12-08 Thread Christophe JAILLET
If 'mtd_device_parse_register()' fails, we still return 0 which mean success. Return the error code instead, as done in all the other error handling paths. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Compile tested-only v2: call 'onenand_release()' to undo 'onenan

[PATCH 2/2 v2] mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails

2017-12-08 Thread Christophe JAILLET
If 'mtd_device_parse_register()' fails, we still return 0 which mean success. Return the error code instead, as done in all the other error handling paths. Signed-off-by: Christophe JAILLET --- Compile tested-only v2: call 'onenand_release()' to undo 'onenand_scan()' --- drivers/mtd/onenand

[PATCH 1/2 v2] mtd: onenand: samsung: use devm_ function to simplify code and fix some leaks

2017-12-08 Thread Christophe JAILLET
-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Compile tested-only v2: use devm_ioremap_resource() --- drivers/mtd/onenand/samsung.c | 164 -- 1 file changed, 29 insertions(+), 135 deletions(-) diff --git a/drivers/mtd/onenand/samsung.c b/drive

<    2   3   4   5   6   7   8   9   10   11   >