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
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
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
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...
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
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
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
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
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
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
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
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
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
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
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
'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
'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
'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
'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
'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
'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
'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
'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
'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
'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
'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
'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
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
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
-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
-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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
'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
'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
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
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 --
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
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
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
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
'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
'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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
'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_
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
'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
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
-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
-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
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
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
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
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
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
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
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
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
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>
'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/
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>
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
'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
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
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
901 - 1000 of 1619 matches
Mail list logo