[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 --- drivers/soc/fsl/qe/qe_tdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe

[PATCH 1/2] soc/fsl/qe: Fix a potential NULL pointer dereference in an error handling path

2017-08-20 Thread Christophe JAILLET
sl/qe: Add QE TDM lib") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- This patch is only a guess that sounds logical to me. I propose to remove this 'devm_iounmap' mainly because of its name (if it is managed, why should be manually handle it here ?) --- drivers/soc

[PATCH 1/2] soc/fsl/qe: Fix a potential NULL pointer dereference in an error handling path

2017-08-20 Thread Christophe JAILLET
sl/qe: Add QE TDM lib") Signed-off-by: Christophe JAILLET --- This patch is only a guess that sounds logical to me. I propose to remove this 'devm_iounmap' mainly because of its name (if it is managed, why should be manually handle it here ?) --- drivers/soc/fsl/qe/qe_tdm.c | 1 - 1 file

[PATCH v2] phy: qcom-usb-hsic: Fix error handling

2017-08-20 Thread Christophe JAILLET
According to error handling in this function, it is likely that going to 'err_ulpi' was expected here. Fixes: 605b8652f7f0 ("phy: Add support for Qualcomm's USB HSIC phy") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> Reviewed-by: Stephen Boyd <stephen.b...

[PATCH v2] phy: qcom-usb-hsic: Fix error handling

2017-08-20 Thread Christophe JAILLET
According to error handling in this function, it is likely that going to 'err_ulpi' was expected here. Fixes: 605b8652f7f0 ("phy: Add support for Qualcomm's USB HSIC phy") Signed-off-by: Christophe JAILLET Reviewed-by: Stephen Boyd --- v2: rebase after commit 0b56e9a7e835 which has

Re: [PATCH] net: ibm: emac: Fix some error handling path in 'emac_probe()'

2017-08-19 Thread Christophe JAILLET
Le 19/08/2017 à 15:22, Christian Lamparter a écrit : On Saturday, August 19, 2017 1:07:57 AM CEST Christophe JAILLET wrote: If 'irq_of_parse_and_map()' or 'of_address_to_resource()' fail, 'err' is known to be 0 at this point. So return -ENODEV instead in the first case and propagate the error

Re: [PATCH] net: ibm: emac: Fix some error handling path in 'emac_probe()'

2017-08-19 Thread Christophe JAILLET
Le 19/08/2017 à 15:22, Christian Lamparter a écrit : On Saturday, August 19, 2017 1:07:57 AM CEST Christophe JAILLET wrote: If 'irq_of_parse_and_map()' or 'of_address_to_resource()' fail, 'err' is known to be 0 at this point. So return -ENODEV instead in the first case and propagate the error

[PATCH v2] net: ibm: emac: Fix some error handling path in 'emac_probe()'

2017-08-19 Thread Christophe JAILLET
of the 'emac_instance struct' becomes redundant and is removed. While at it, turn a 'err != 0' test into an equivalent 'err' to be more consistent. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- v2: use of_iomap() to simplify code remove 'rsrc_regs' field of the 'emac_in

[PATCH v2] net: ibm: emac: Fix some error handling path in 'emac_probe()'

2017-08-19 Thread Christophe JAILLET
of the 'emac_instance struct' becomes redundant and is removed. While at it, turn a 'err != 0' test into an equivalent 'err' to be more consistent. Signed-off-by: Christophe JAILLET --- v2: use of_iomap() to simplify code remove 'rsrc_regs' field of the 'emac_instance struct' update comment

[PATCH] cpufreq: ti: Fix 'of_node_put' being called twice in error handling path

2017-08-19 Thread Christophe JAILLET
If 'dev_pm_opp_set_supported_hw()' fails, 'opp_data->opp_node' refcount will be decremented 2 times. One, just a few lines above, and another one in the error handling path. Fix it by simply moving the 'of_node_put' call of the normal path. Signed-off-by: Christophe JAILLET <christoph

[PATCH] cpufreq: ti: Fix 'of_node_put' being called twice in error handling path

2017-08-19 Thread Christophe JAILLET
If 'dev_pm_opp_set_supported_hw()' fails, 'opp_data->opp_node' refcount will be decremented 2 times. One, just a few lines above, and another one in the error handling path. Fix it by simply moving the 'of_node_put' call of the normal path. Signed-off-by: Christophe JAILLET --- drivers/cpuf

[PATCH] net: ibm: emac: Fix some error handling path in 'emac_probe()'

2017-08-18 Thread Christophe JAILLET
consistent. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/ibm/emac/core.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index 95135d

[PATCH] net: ibm: emac: Fix some error handling path in 'emac_probe()'

2017-08-18 Thread Christophe JAILLET
consistent. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/ibm/emac/core.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index 95135d20458f..1af56a97fb47 100644 --- a/drivers/net

[PATCH] mcb: Fix an error handling path in 'chameleon_parse_cells()'

2017-08-16 Thread Christophe JAILLET
lized in this function")) Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/mcb/mcb-parse.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c index ee7fb6ec96bd..7369bda3442f 100644 --- a/drivers

[PATCH] mcb: Fix an error handling path in 'chameleon_parse_cells()'

2017-08-16 Thread Christophe JAILLET
lized in this function")) Signed-off-by: Christophe JAILLET --- drivers/mcb/mcb-parse.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c index ee7fb6ec96bd..7369bda3442f 100644 --- a/drivers/mcb/mcb-parse.c +++ b/drivers/mcb/m

[PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()'

2017-08-15 Thread Christophe JAILLET
'rc' is known to be 0 at this point. If 'platform_get_resource()' or 'devm_ioremap()' fail, return -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/ata/ahci_da850.c | 8 ++-- 1 file changed, 6 insertions(+), 2 del

[PATCH] sata: ahci-da850: Fix some error handling paths in 'ahci_da850_probe()'

2017-08-15 Thread Christophe JAILLET
'rc' is known to be 0 at this point. If 'platform_get_resource()' or 'devm_ioremap()' fail, return -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/ata/ahci_da850.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/ata

[PATCH] crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()'

2017-08-15 Thread Christophe JAILLET
'err' is known to be 0 at this point. If 'kzalloc()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/crypto/cavium/nitrox/nitrox_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH] crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()'

2017-08-15 Thread Christophe JAILLET
'err' is known to be 0 at this point. If 'kzalloc()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/crypto/cavium/nitrox/nitrox_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/cavium/nitrox

[PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'

2017-08-15 Thread Christophe JAILLET
'res' is known to be 0 at this point. If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/edac/altera_edac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()'

2017-08-15 Thread Christophe JAILLET
'res' is known to be 0 at this point. If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/edac/altera_edac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac

[PATCH] EDAC, thunderx: Fix an error handling path in 'thunderx_lmc_probe()'

2017-08-15 Thread Christophe JAILLET
'ret' is known to be 0 at this point. If 'ioremap()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/edac/thunderx_edac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/edac/thunderx_ed

[PATCH] EDAC, thunderx: Fix an error handling path in 'thunderx_lmc_probe()'

2017-08-15 Thread Christophe JAILLET
'ret' is known to be 0 at this point. If 'ioremap()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/edac/thunderx_edac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c index

[PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

2017-08-15 Thread Christophe JAILLET
'rc' is known to be 0 at this point. If 'create_context()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/cxlflash/superpipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/cx

[PATCH] scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'

2017-08-15 Thread Christophe JAILLET
'rc' is known to be 0 at this point. If 'create_context()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/scsi/cxlflash/superpipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi

[PATCH] crypto: inside-secure - fix an error handling path in safexcel_probe()

2017-08-15 Thread Christophe JAILLET
'ret' is known to be 0 at this point. If 'safexcel_request_ring_irq()' fails, it returns an error code. Return this value instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/crypto/inside-secure/safexcel.c | 5 +++-- 1 file chan

[PATCH] crypto: inside-secure - fix an error handling path in safexcel_probe()

2017-08-15 Thread Christophe JAILLET
'ret' is known to be 0 at this point. If 'safexcel_request_ring_irq()' fails, it returns an error code. Return this value instead of 0 which means success. Signed-off-by: Christophe JAILLET --- drivers/crypto/inside-secure/safexcel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH 3/3 v2] thermal: core: Fix resources release in error paths in thermal_zone_device_register()

2017-08-08 Thread Christophe JAILLET
handling paths: one before 'device_register()', and one after it. This is needed because some resources are released in 'thermal_release()'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Should 'ida_simple_remove()' be folded somehow into 'thermal_release()'? --- d

[PATCH 3/3 v2] thermal: core: Fix resources release in error paths in thermal_zone_device_register()

2017-08-08 Thread Christophe JAILLET
handling paths: one before 'device_register()', and one after it. This is needed because some resources are released in 'thermal_release()'. Signed-off-by: Christophe JAILLET --- Should 'ida_simple_remove()' be folded somehow into 'thermal_release()'? --- drivers/thermal/thermal_core.c | 23

[PATCH 1/3 v2] thermal: core: Add some new helper functions to free resources

2017-08-08 Thread Christophe JAILLET
-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- These functions will be used in patch 2/3 in order to simplify 'thermal_release()' I've tried to implement it as close a possible as the way the resources have been allocated. However, in 'thermal_release()', the code is simplier w

[PATCH 1/3 v2] thermal: core: Add some new helper functions to free resources

2017-08-08 Thread Christophe JAILLET
-off-by: Christophe JAILLET --- These functions will be used in patch 2/3 in order to simplify 'thermal_release()' I've tried to implement it as close a possible as the way the resources have been allocated. However, in 'thermal_release()', the code is simplier without some additionnal 'if'. No sure

[PATCH 2/3 v2] thermal: core: Use the new 'thermal_zone_destroy_device_groups()' helper function

2017-08-08 Thread Christophe JAILLET
Simplify code by using the new 'thermal_zone_destroy_device_groups()' helper function. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/thermal/thermal_core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_co

[PATCH 2/3 v2] thermal: core: Use the new 'thermal_zone_destroy_device_groups()' helper function

2017-08-08 Thread Christophe JAILLET
Simplify code by using the new 'thermal_zone_destroy_device_groups()' helper function. Signed-off-by: Christophe JAILLET --- drivers/thermal/thermal_core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c

[PATCH 0/3 v2] thermal: core: Fix some error handling code in 'thermal_zone_device_register()'

2017-08-08 Thread Christophe JAILLET
ore easily - split the error handling path into 2. One before a successful call to 'device_register()', and one after Christophe JAILLET (3): thermal: core: Add some new helper functions to free resources thermal: core: Use the new 'thermal_zone_destroy_device_groups()' helper funct

[PATCH 0/3 v2] thermal: core: Fix some error handling code in 'thermal_zone_device_register()'

2017-08-08 Thread Christophe JAILLET
ore easily - split the error handling path into 2. One before a successful call to 'device_register()', and one after Christophe JAILLET (3): thermal: core: Add some new helper functions to free resources thermal: core: Use the new 'thermal_zone_destroy_device_groups()' helper funct

Re: [PATCH 2/3] thermal: core: Reorder 'thermal_zone_device_register()' error handling code

2017-08-08 Thread Christophe JAILLET
Le 08/08/2017 à 10:49, Zhang Rui a écrit : On Sun, 2017-07-16 at 08:59 +0200, Christophe JAILLET wrote: Reorder code in the error handling path in order to match the way resources have been allocated. With this new order, we can avoid a call to 'device_unregister

Re: [PATCH 2/3] thermal: core: Reorder 'thermal_zone_device_register()' error handling code

2017-08-08 Thread Christophe JAILLET
Le 08/08/2017 à 10:49, Zhang Rui a écrit : On Sun, 2017-07-16 at 08:59 +0200, Christophe JAILLET wrote: Reorder code in the error handling path in order to match the way resources have been allocated. With this new order, we can avoid a call to 'device_unregister

Re: [PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

2017-08-08 Thread Christophe JAILLET
Le 07/08/2017 à 08:36, Uwe Kleine-König a écrit : On Mon, Aug 07, 2017 at 01:49:53AM +0200, Christophe JAILLET wrote: 'devm_pinctrl_get()' never returns NULL, so this test can be simplified. That's wrong. If CONFIG_PINCTRL is disabled devm_pinctrl_get returns NULL. But I think this shouldn't

Re: [PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

2017-08-08 Thread Christophe JAILLET
Le 07/08/2017 à 08:36, Uwe Kleine-König a écrit : On Mon, Aug 07, 2017 at 01:49:53AM +0200, Christophe JAILLET wrote: 'devm_pinctrl_get()' never returns NULL, so this test can be simplified. That's wrong. If CONFIG_PINCTRL is disabled devm_pinctrl_get returns NULL. But I think this shouldn't

Re: [PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

2017-08-08 Thread Christophe JAILLET
Le 07/08/2017 à 09:16, Julia Lawall a écrit : On Mon, 7 Aug 2017, Uwe Kleine-König wrote: On Mon, Aug 07, 2017 at 01:49:53AM +0200, Christophe JAILLET wrote: 'devm_pinctrl_get()' never returns NULL, so this test can be simplified. That's wrong. If CONFIG_PINCTRL is disabled devm_pinctrl_get

Re: [PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

2017-08-08 Thread Christophe JAILLET
Le 07/08/2017 à 09:16, Julia Lawall a écrit : On Mon, 7 Aug 2017, Uwe Kleine-König wrote: On Mon, Aug 07, 2017 at 01:49:53AM +0200, Christophe JAILLET wrote: 'devm_pinctrl_get()' never returns NULL, so this test can be simplified. That's wrong. If CONFIG_PINCTRL is disabled devm_pinctrl_get

Re: [PATCH] scsi: mpt3sas: Fix memory allocation failure test in 'mpt3sas_base_attach()'

2017-08-07 Thread Christophe JAILLET
Le 07/08/2017 à 10:25, walter harms a écrit : Am 07.08.2017 00:51, schrieb Christophe JAILLET: In the lines above this test, 8 'kzalloc' are performed, but only 7 results are tested. Add the missing one (i.e. '!ioc->port_enable_cmds.reply'). Signed-off-by: Christophe JAILLET <christoph

Re: [PATCH] scsi: mpt3sas: Fix memory allocation failure test in 'mpt3sas_base_attach()'

2017-08-07 Thread Christophe JAILLET
Le 07/08/2017 à 10:25, walter harms a écrit : Am 07.08.2017 00:51, schrieb Christophe JAILLET: In the lines above this test, 8 'kzalloc' are performed, but only 7 results are tested. Add the missing one (i.e. '!ioc->port_enable_cmds.reply'). Signed-off-by: Christophe JAILLET --- driv

[PATCH] extcon: cros-ec: Fix a potential NULL pointer dereference

2017-08-07 Thread Christophe JAILLET
Return -ENOMEM in case of memory allocation failure. This avoids a NULL pointer dereference. Fixes: c69831666109 ("extcon: cros-ec: Add extcon-cros-ec driver to support display out") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/extcon/extcon-us

[PATCH] extcon: cros-ec: Fix a potential NULL pointer dereference

2017-08-07 Thread Christophe JAILLET
Return -ENOMEM in case of memory allocation failure. This avoids a NULL pointer dereference. Fixes: c69831666109 ("extcon: cros-ec: Add extcon-cros-ec driver to support display out") Signed-off-by: Christophe JAILLET --- drivers/extcon/extcon-usbc-cros-ec.c | 2 ++ 1 file changed, 2

[PATCH] ASoC: mediatek: Fix an error checking code

2017-08-06 Thread Christophe JAILLET
Check the value returned by 'devm_clk_get()' instead of the clock identifier which can never be an ERR code. Fixes: d6f3710a56e1 ("ASoC: mediatek: add structure define and clock control for 2701") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- sound/soc

[PATCH] ASoC: mediatek: Fix an error checking code

2017-08-06 Thread Christophe JAILLET
Check the value returned by 'devm_clk_get()' instead of the clock identifier which can never be an ERR code. Fixes: d6f3710a56e1 ("ASoC: mediatek: add structure define and clock control for 2701") Signed-off-by: Christophe JAILLET --- sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c

[PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

2017-08-06 Thread Christophe JAILLET
'devm_pinctrl_get()' never returns NULL, so this test can be simplified. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/buss

[PATCH] i2c: imx: Remove a useless test in 'i2c_imx_init_recovery_info()'

2017-08-06 Thread Christophe JAILLET
'devm_pinctrl_get()' never returns NULL, so this test can be simplified. Signed-off-by: Christophe JAILLET --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 54a47b40546f

[PATCH] scsi: mpt3sas: Fix memory allocation failure test in 'mpt3sas_base_attach()'

2017-08-06 Thread Christophe JAILLET
In the lines above this test, 8 'kzalloc' are performed, but only 7 results are tested. Add the missing one (i.e. '!ioc->port_enable_cmds.reply'). Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/mpt3sas/mpt3sas_base.c | 8 1 file changed, 4 i

[PATCH] scsi: mpt3sas: Fix memory allocation failure test in 'mpt3sas_base_attach()'

2017-08-06 Thread Christophe JAILLET
In the lines above this test, 8 'kzalloc' are performed, but only 7 results are tested. Add the missing one (i.e. '!ioc->port_enable_cmds.reply'). Signed-off-by: Christophe JAILLET --- drivers/scsi/mpt3sas/mpt3sas_base.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --

[PATCH 3/3] power: supply: charger-manager: Slighly simplify code

2017-08-06 Thread Christophe JAILLET
Use 'sizeof(*var)' instead of the equivalent 'sizeof(data structure type)' because it is less verbose. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/power/supply/charger-manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[PATCH 3/3] power: supply: charger-manager: Slighly simplify code

2017-08-06 Thread Christophe JAILLET
Use 'sizeof(*var)' instead of the equivalent 'sizeof(data structure type)' because it is less verbose. Signed-off-by: Christophe JAILLET --- drivers/power/supply/charger-manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b

[PATCH 2/3] power: supply: charger-manager: Fix a comment

2017-08-06 Thread Christophe JAILLET
Update a comment which is no more up to date since commit 2ed9e9b653095. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/power/supply/charger-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/charger-manage

[PATCH 2/3] power: supply: charger-manager: Fix a comment

2017-08-06 Thread Christophe JAILLET
Update a comment which is no more up to date since commit 2ed9e9b653095. Signed-off-by: Christophe JAILLET --- drivers/power/supply/charger-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger

[PATCH 1/3] power: supply: charger-manager: Fix a NULL pointer dereference in 'charger_manager_probe()'

2017-08-06 Thread Christophe JAILLET
'devm_kzalloc()' can return NULL. Return -ENOMEM in this case in order to avoid a NULL pointer dereference later on. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/power/supply/charger-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers

[PATCH 1/3] power: supply: charger-manager: Fix a NULL pointer dereference in 'charger_manager_probe()'

2017-08-06 Thread Christophe JAILLET
'devm_kzalloc()' can return NULL. Return -ENOMEM in this case in order to avoid a NULL pointer dereference later on. Signed-off-by: Christophe JAILLET --- drivers/power/supply/charger-manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/power/supply/charger-manager.c b

[PATCH 0/3] power: supply: charger-manager: 1 fix and 2 minor clean-ups

2017-08-06 Thread Christophe JAILLET
This patch series improves 'charger_manager_probe()'. The first patch is about a missing memory allocation failure test. The 2 others are just things spotted in this function: - a comment that is no more up to date - a style issue (which saves 1 line) Christophe JAILLET (3): power: supply

[PATCH 0/3] power: supply: charger-manager: 1 fix and 2 minor clean-ups

2017-08-06 Thread Christophe JAILLET
This patch series improves 'charger_manager_probe()'. The first patch is about a missing memory allocation failure test. The 2 others are just things spotted in this function: - a comment that is no more up to date - a style issue (which saves 1 line) Christophe JAILLET (3): power: supply

[PATCH] qed: Fix a memory allocation failure test in 'qed_mcp_cmd_init()'

2017-08-06 Thread Christophe JAILLET
the 2 'kzalloc()' instead. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp

[PATCH] qed: Fix a memory allocation failure test in 'qed_mcp_cmd_init()'

2017-08-06 Thread Christophe JAILLET
the 2 'kzalloc()' instead. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c index c1ecce6b9141..376485d99357 10064

[PATCH] i40e: Fix a potential NULL pointer dereference

2017-08-06 Thread Christophe JAILLET
If 'kzalloc()' fails, a NULL pointer will be dereferenced. Return an error code (-ENOMEM) instead. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/et

[PATCH] i40e: Fix a potential NULL pointer dereference

2017-08-06 Thread Christophe JAILLET
If 'kzalloc()' fails, a NULL pointer will be dereferenced. Return an error code (-ENOMEM) instead. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

[PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'

2017-08-06 Thread Christophe JAILLET
If 'of_flash_probe_gemini()' or 'of_flash_probe_versatile()' fail, we must reslease some resources, as already done in all error handling paths in this function. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/mtd/maps/physmap_of_core.c | 4 ++-- 1 file chan

[PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()'

2017-08-06 Thread Christophe JAILLET
If 'of_flash_probe_gemini()' or 'of_flash_probe_versatile()' fail, we must reslease some resources, as already done in all error handling paths in this function. Signed-off-by: Christophe JAILLET --- drivers/mtd/maps/physmap_of_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] drm/i915/selftests: Fix an error handling path in 'mock_gem_device()'

2017-07-19 Thread Christophe JAILLET
Goto the right label in case of error, otherwise there is a leak. This has been introduced by c5cf9a9147ff. In this patch a goto has not been updated. Fixes: c5cf9a9147ff ("drm/i915: Create a kmem_cache to allocate struct i915_priolist from") Signed-off-by: Christophe JAILLET <ch

[PATCH] drm/i915/selftests: Fix an error handling path in 'mock_gem_device()'

2017-07-19 Thread Christophe JAILLET
Goto the right label in case of error, otherwise there is a leak. This has been introduced by c5cf9a9147ff. In this patch a goto has not been updated. Fixes: c5cf9a9147ff ("drm/i915: Create a kmem_cache to allocate struct i915_priolist from") Signed-off-by: Christophe JAILLET --- d

[PATCH] dmaengine: ioatdma: Fix error handling path in 'ioat_dma_self_test()'

2017-07-19 Thread Christophe JAILLET
If the 'memcmp' fails, free allocated resources as done in all other error handling paths. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Please review carefully, this patch looks "too obvious" to me! --- drivers/dma/ioat/init.c | 2 +- 1 file changed, 1

[PATCH] dmaengine: ioatdma: Fix error handling path in 'ioat_dma_self_test()'

2017-07-19 Thread Christophe JAILLET
If the 'memcmp' fails, free allocated resources as done in all other error handling paths. Signed-off-by: Christophe JAILLET --- Please review carefully, this patch looks "too obvious" to me! --- drivers/dma/ioat/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] crypto: ixp4xx - Fix error handling path in 'aead_perform()'

2017-07-19 Thread Christophe JAILLET
lised warning") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/crypto/ixp4xx_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 427cbe012729..1ccbe15b5f16 1006

[PATCH] crypto: ixp4xx - Fix error handling path in 'aead_perform()'

2017-07-19 Thread Christophe JAILLET
lised warning") Signed-off-by: Christophe JAILLET --- drivers/crypto/ixp4xx_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 427cbe012729..1ccbe15b5f16 100644 --- a/drivers/crypto/ixp4xx_cryp

[PATCH] atm: zatm: Fix an error handling path in 'zatm_init_one()'

2017-07-17 Thread Christophe JAILLET
If 'dma_set_mask_and_coherent()' fails, we must undo the previous 'pci_request_regions()' call. Adjust corresponding 'goto' to jump at the right place of the error handling path. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/atm/zatm.c | 2 +- 1 file chan

[PATCH] atm: zatm: Fix an error handling path in 'zatm_init_one()'

2017-07-17 Thread Christophe JAILLET
If 'dma_set_mask_and_coherent()' fails, we must undo the previous 'pci_request_regions()' call. Adjust corresponding 'goto' to jump at the right place of the error handling path. Signed-off-by: Christophe JAILLET --- drivers/atm/zatm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] i40iw: Simplify code

2017-07-16 Thread Christophe JAILLET
Axe a few lines of code and re-use existing error handling path to avoid code duplication. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/infiniband/hw/i40iw/i40iw_pble.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/d

[PATCH] i40iw: Simplify code

2017-07-16 Thread Christophe JAILLET
Axe a few lines of code and re-use existing error handling path to avoid code duplication. Signed-off-by: Christophe JAILLET --- drivers/infiniband/hw/i40iw/i40iw_pble.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_pble.c b

[PATCH] nvme-pci: Fix an error handling path in 'nvme_probe()'

2017-07-16 Thread Christophe JAILLET
Release resources in the correct order in order not to miss a 'put_device()' if 'nvme_dev_map()' fails. Fixes: b00a726a9fd8 ("NVMe: Don't unmap controller registers on reset") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/nvme/host/pci.c | 7

[PATCH] nvme-pci: Fix an error handling path in 'nvme_probe()'

2017-07-16 Thread Christophe JAILLET
Release resources in the correct order in order not to miss a 'put_device()' if 'nvme_dev_map()' fails. Fixes: b00a726a9fd8 ("NVMe: Don't unmap controller registers on reset") Signed-off-by: Christophe JAILLET --- drivers/nvme/host/pci.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH 3/3] thermal: core: Avoid code duplication in 'thermal_zone_device_register()'

2017-07-16 Thread Christophe JAILLET
Jump in the error handling path in order to avoid code duplication if some function fail. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/thermal/thermal_core.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/t

[PATCH 3/3] thermal: core: Avoid code duplication in 'thermal_zone_device_register()'

2017-07-16 Thread Christophe JAILLET
Jump in the error handling path in order to avoid code duplication if some function fail. Signed-off-by: Christophe JAILLET --- drivers/thermal/thermal_core.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal

[PATCH 1/3] thermal: core: Fix a memory leak in 'thermal_zone_device_register()' error handling path

2017-07-16 Thread Christophe JAILLET
'tz' is freed in some error handling paths but not in the main one. So free it also here to avoid a memory leak. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/thermal/thermal_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/thermal_

[PATCH 0/3] thermal: core: Fix some error handling code in 'thermal_zone_device_register()'

2017-07-16 Thread Christophe JAILLET
reorders code in the error handling path to have it more logical. The 3rd simplifies the code. Not 100% sure, but the 2nd one could also avoid an OOPS because we try to unregister something that has never been registered. Christophe JAILLET (3): thermal: core: Fix a memory leak

[PATCH 1/3] thermal: core: Fix a memory leak in 'thermal_zone_device_register()' error handling path

2017-07-16 Thread Christophe JAILLET
'tz' is freed in some error handling paths but not in the main one. So free it also here to avoid a memory leak. Signed-off-by: Christophe JAILLET --- drivers/thermal/thermal_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal

[PATCH 0/3] thermal: core: Fix some error handling code in 'thermal_zone_device_register()'

2017-07-16 Thread Christophe JAILLET
reorders code in the error handling path to have it more logical. The 3rd simplifies the code. Not 100% sure, but the 2nd one could also avoid an OOPS because we try to unregister something that has never been registered. Christophe JAILLET (3): thermal: core: Fix a memory leak

[PATCH 2/3] thermal: core: Reorder 'thermal_zone_device_register()' error handling code

2017-07-16 Thread Christophe JAILLET
-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/thermal/thermal_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9743f3e65eb0..c58714800660 100644 --- a/drivers/thermal/thermal_core.c

[PATCH 2/3] thermal: core: Reorder 'thermal_zone_device_register()' error handling code

2017-07-16 Thread Christophe JAILLET
-by: Christophe JAILLET --- drivers/thermal/thermal_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9743f3e65eb0..c58714800660 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c

[PATCH v2] iwlwifi: mvm: Fix a memory leak in an error handling path in 'iwl_mvm_sar_get_wgds_table()'

2017-07-14 Thread Christophe JAILLET
We should free 'wgds.pointer' here as done a few lines above in another error handling path. It was allocated within 'acpi_evaluate_object()'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- v2: rebase after 7fe90e0e3d60 ("iwlwifi: mvm: refactor geo init&qu

[PATCH v2] iwlwifi: mvm: Fix a memory leak in an error handling path in 'iwl_mvm_sar_get_wgds_table()'

2017-07-14 Thread Christophe JAILLET
We should free 'wgds.pointer' here as done a few lines above in another error handling path. It was allocated within 'acpi_evaluate_object()'. Signed-off-by: Christophe JAILLET --- v2: rebase after 7fe90e0e3d60 ("iwlwifi: mvm: refactor geo init") Moreovern a comment in '/drivers/a

[PATCH] iwlwifi: mvm: Fix a memory leak in an error handling path in 'iwl_mvm_sar_get_wgds_table()'

2017-07-11 Thread Christophe JAILLET
We should free 'wgds.pointer' here as done a few lines above in another error handling path. It was allocated within 'acpi_evaluate_object()'. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- A comment in '/drivers/acpi/acpica/utalloc.c' states that: /* [...] Note: The

[PATCH] iwlwifi: mvm: Fix a memory leak in an error handling path in 'iwl_mvm_sar_get_wgds_table()'

2017-07-11 Thread Christophe JAILLET
We should free 'wgds.pointer' here as done a few lines above in another error handling path. It was allocated within 'acpi_evaluate_object()'. Signed-off-by: Christophe JAILLET --- A comment in '/drivers/acpi/acpica/utalloc.c' states that: /* [...] Note: The caller should use acpi_os_free

[PATCH v2] mrf24j40: Fix en error handling path in 'mrf24j40_probe()'

2017-07-08 Thread Christophe JAILLET
If this check fails, we must release some resources as done everywhere else in this function before returning an error code. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- V2: initialization of ret in this erro path ws missing. Stupid me! --- drivers/net/ieee

[PATCH v2] mrf24j40: Fix en error handling path in 'mrf24j40_probe()'

2017-07-08 Thread Christophe JAILLET
If this check fails, we must release some resources as done everywhere else in this function before returning an error code. Signed-off-by: Christophe JAILLET --- V2: initialization of ret in this erro path ws missing. Stupid me! --- drivers/net/ieee802154/mrf24j40.c | 2 +- 1 file changed, 1

[PATCH] mrf24j40: Fix en error handling path in 'mrf24j40_probe()'

2017-07-08 Thread Christophe JAILLET
If this check fails, we must release some resources as done everywhere else in this function before returning an error code. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ieee802154/mrf24j40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] mrf24j40: Fix en error handling path in 'mrf24j40_probe()'

2017-07-08 Thread Christophe JAILLET
If this check fails, we must release some resources as done everywhere else in this function before returning an error code. Signed-off-by: Christophe JAILLET --- drivers/net/ieee802154/mrf24j40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ieee802154

[PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()'

2017-07-08 Thread Christophe JAILLET
If the first 'kmalloc_array' within the loop fails, we should free what as already been allocated, as done in all other error handling path. Fixes: ce736788e8a9 ("net: stmmac: adding multiple buffers for TX") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr>

[PATCH 3/3] net: stmmac: Make 'alloc_dma_[rt]x_desc_resources()' look even closer

2017-07-08 Thread Christophe JAILLET
'alloc_dma_[rt]x_desc_resources()' functions look very close. Remove a useless initialization and use the same label name for error handling path in order to get them even closer. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/net/ethernet/stmicro/

[PATCH 1/3] net: stmmac: Fix error handling path in 'alloc_dma_rx_desc_resources()'

2017-07-08 Thread Christophe JAILLET
If the first 'kmalloc_array' within the loop fails, we should free what as already been allocated, as done in all other error handling path. Fixes: 54139cf3bb33 ("net: stmmac: adding multiple buffers for rx") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr>

[PATCH 2/3] net: stmmac: Fix error handling path in 'alloc_dma_tx_desc_resources()'

2017-07-08 Thread Christophe JAILLET
If the first 'kmalloc_array' within the loop fails, we should free what as already been allocated, as done in all other error handling path. Fixes: ce736788e8a9 ("net: stmmac: adding multiple buffers for TX") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/stmi

[PATCH 3/3] net: stmmac: Make 'alloc_dma_[rt]x_desc_resources()' look even closer

2017-07-08 Thread Christophe JAILLET
'alloc_dma_[rt]x_desc_resources()' functions look very close. Remove a useless initialization and use the same label name for error handling path in order to get them even closer. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++-- 1 file

[PATCH 1/3] net: stmmac: Fix error handling path in 'alloc_dma_rx_desc_resources()'

2017-07-08 Thread Christophe JAILLET
If the first 'kmalloc_array' within the loop fails, we should free what as already been allocated, as done in all other error handling path. Fixes: 54139cf3bb33 ("net: stmmac: adding multiple buffers for rx") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/stmi

[PATCH 0/3] net: stmmac: Fixes and cleanups in 'alloc_dma_[rt]x_desc_resources()'

2017-07-08 Thread Christophe JAILLET
These patchs are all related to 'alloc_dma_[rt]x_desc_resources()' functions. The 2 first fix an error path where some resources are leaking. I've separated them into 2 patches because the issues have been introduced by 2 deferent commits. The 3rd patch is just a clean-up. Christophe JAILLET (3

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