[PATCH] scsi: qlogicpti: Fix an error handling path in 'qpti_sbus_probe()'

2018-05-10 Thread Christophe JAILLET
k.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- Please review carefully. This patch is proposed because it triggers one of my coccinelle scripts. I'm not 100% sure if correct. The script tries to spot wrongly ordered error handling path. I

[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 V2] scsi: aacraid: Fix some error code

2017-10-23 Thread Christophe JAILLET
If 'scsi_host_alloc', 'kzalloc' or '(*aac_drivers[index].init)' fail, the function will return 0, because 'error' is known to be 0 at this point. Return -ENOMEM in the 2 first cases and -ENODEV in the third one. This patch also removes a useless 'error = -ENODEV'. Signed-off-by: Christophe

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

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

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

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

[PATCH] scsi: qedf: Fix a potential NULL pointer dereference

2017-08-20 Thread Christophe JAILLET
. Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/qedf/qedf_els.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/d

[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

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

[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 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 2/2] scsi: qedi: Use 'dma_zalloc_coherent' to reduce code verbosity.

2017-06-11 Thread Christophe JAILLET
Replace some 'dma_alloc_coherent+memset' by some quivalent 'dma_zalloc_coherent' in order to reduce code verbosity Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- This patch generates some checkpatch errors about the use of space to indent code. I've left it as-is t

[PATCH 1/2] scsi: qedi: Fix a return value in case of error in 'qedi_alloc_global_queues'

2017-06-11 Thread Christophe JAILLET
We should return -ENOMEM in case of memory allocation error, as done elsewhere in this function. Fixes: ace7f46ba5fde ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/qedi/qedi

[PATCH 0/2] Fix a return value + some cleanups

2017-06-11 Thread Christophe JAILLET
This patch serie first fixes a case where an error code was missing. The other path is just a cleanup in the same area. Christophe JAILLET (2): scsi: qedi: Fix a return value in case of error in 'qedi_alloc_global_queues' scsi: qedi: Use 'dma_zalloc_coherent' to reduce code verbosity

[PATCH 2/3] scsi: qedf: Use 'dma_zalloc_coherent' to reduce code verbosity.

2017-06-11 Thread Christophe JAILLET
Replace some 'dma_alloc_coherent+memset' by some quivalent 'dma_zalloc_coherent' in order to reduce code verbosity Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/qedf/qedf_main.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-)

[PATCH 3/3] scsi: qedf: Merge a few quoted strings split across lines

2017-06-11 Thread Christophe JAILLET
Merge some quoted strings to improve readability and to save some lines of code. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/qedf/qedf_main.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/scs

[PATCH 1/3] scsi: qedf: Fix a return value in case of error in 'qedf_alloc_global_queues'

2017-06-11 Thread Christophe JAILLET
We should return -ENOMEM in case of memory allocation error, as done elsewhere in this function. Fixes: 61d8658b4a435 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/qedf/qedf

[PATCH 0/3] scsi: qedf: Fix a return value + some cleanups

2017-06-11 Thread Christophe JAILLET
This patch serie first fixes a case where an error code was missing. The 2 other patches are just cleanups in the same area. Christophe JAILLET (3): scsi: qedf: Fix a return value in case of error in 'qedf_alloc_global_queues' scsi: qedf: Use 'dma_zalloc_coherent' to reduce code verbosity

[PATCH] scsi: mpt3sas: Fix value returned by 'mpt3sas_base_attach' in case of error

2017-06-10 Thread Christophe JAILLET
'r' is known to be zero here, so it must be set to -ENOMEM is one of these 'kzalloc' fails. Fixes: c696f7b83edea ("scsi: mpt3sas: Implement device_remove_in_progress check in IOCTL path") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/mpt3sa

[PATCH] scsi: aacraid: Fix some error code

2017-06-10 Thread Christophe JAILLET
If 'scsi_host_alloc', 'kzalloc' or '(*aac_drivers[index].init)' fail, the function will return 0, because 'error' is known to be 0 at this point. Return -ENOMEM in the 2 first cases and -ENODEV in the third one. This patch also removes a useless 'error = -ENODEV'. Signed-off-by: Christophe

[PATCH] qlogicpti: Fix resource releasing in order handling path

2017-05-08 Thread Christophe JAILLET
Reorder 'fail_free_irq' and 'fail_unmap_regs' in order to correctly free resources in case of error. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/qlogicpti.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qlogi

Spurious code in drivers/scsi/qla2xxx/qla_os.

2017-04-14 Thread Marion &amp; Christophe JAILLET
Hi, the following code looks really spurious to me. The function 'qla2x00_probe_one' is too hairy for me to understand it and propose a patch if needed. So I just report it to you in case of interest. (BTW, the code in 'qla2x00_unmap_iobases' looks also quite close to the code below. Maybe

[PATCH] sd: Fix error handling

2017-02-19 Thread Christophe JAILLET
Reorder 'out_free' and 'out_free_devt' error handling labels in order to match the way resources have been allocated. Fixes: 0dba1314d4f8 ("scsi, block: fix duplicate bdi name registration crashes") Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drive

[PATCH] scsi: hpsa: Use 'pci_dma_mapping_error()' instead of 'dma_mapping_error()'

2017-02-18 Thread Christophe JAILLET
Use 'pci_dma_mapping_error()' instead of 'dma_mapping_error()' because it is more consistent with the rest of the code. It is also a little less verbove. While at it, remove some '(dma_addr_t)' casts in order to be consistent within the file. Signed-off-by: Christophe JAILLET <christophe.j

[PATCH] bnx2fc: shift wrapping bug in bnx2fc_process_unsol_compl()

2016-11-26 Thread Christophe JAILLET
BNX2FC_NUM_ERR_BITS is 63. err_warn_bit_map is a u64. So, to make sure that no shift wrapping will occur, we need need additionnal casting. The same test is already done a few lines above and '(u64)1' is already used there. So just do the same here. Signed-off-by: Christophe JAILLET

[PATCH] bnx2fc: Simplify code

2016-09-03 Thread Christophe JAILLET
Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent to 'list_splice_init'. This has been spotted with the following coccinelle script: / @@ expression y,z; @@ - list_splice(y,z); - INIT_LIST_HEAD(y); + list_splice_init(y,z); Signed-off-by: Christophe JAILLET

[PATCH] lpcf: Simplify code

2016-09-03 Thread Christophe JAILLET
Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent to 'list_splice_init'. This has been spotted with the following coccinelle script: / @@ expression y,z; @@ - list_splice(y,z); - INIT_LIST_HEAD(y); + list_splice_init(y,z); Signed-off-by: Christophe JAILLET

[PATCH] megaraid_sas: Fix the search of first memory bar

2016-08-21 Thread Christophe JAILLET
The 2nd parameter of 'find_first_bit' is the number of bits to search. In this case, we are passing 'sizeof(unsigned long)' which is likely to be 4. It is likely that the number of bits in a long was expected here, so use BITS_PER_LONG instead. Signed-off-by: Christophe JAILLET <christophe.j

Re: [PATCH 2/2 v3] be2iscsi: Fix some error messages

2016-08-13 Thread Christophe JAILLET
Le 13/08/2016 à 13:35, Joe Perches a écrit : @@ -268,7 +268,7 @@ static int beiscsi_eh_abort(struct scsi_cmnd *sc) _cmd.dma); if (nonemb_cmd.va == NULL) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH, - "BM_%d :

[PATCH 2/2 v3] be2iscsi: Fix some error messages

2016-08-13 Thread Christophe JAILLET
This fixes: - missing spaces in string split on several lines - extra spaces after ':' - missing '\n' at the end of some messages - turn a \\n to \n in 1 message - concatenate strings on the same line to fix checkpatch warnings Signed-off-by: Christophe JAILLET <christophe.j

[PATCH 2/2 v2] be2iscsi: Fix some error messages

2016-08-13 Thread Christophe JAILLET
This fixes: - missing spaces in string split on several lines - extra spaces after ':' - missing '\n' at the end of some messages - turn a \\n to \n in 1 message (v2) - concatenate strings on the same line to fix checkpatch warnings (v2) Signed-off-by: Christophe JAILLET

Re: [PATCH 2/2] be2iscsi: Fix some error messages

2016-08-12 Thread Christophe JAILLET
Le 12/08/2016 à 12:30, Julia Lawall a écrit : On Fri, 12 Aug 2016, Christophe JAILLET wrote: This fixes: - missing spaces in string split on several lines - extra spaces after ':' - missing '\n' at the end of some messages - too long lines I think that the strings should

[PATCH 1/2] be2iscsi: Fix error return code

2016-08-12 Thread Christophe JAILLET
We know that 'ret' is not an error code because it has been tested a few lines above. So, if one of these function fails, 0 will be returned instead of an error code. Return -ENOMEM instead. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/be2iscsi/be_

[PATCH 2/2] be2iscsi: Fix some error messages

2016-08-12 Thread Christophe JAILLET
This fixes: - missing spaces in string split on several lines - extra spaces after ':' - missing '\n' at the end of some messages - too long lines Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/be2iscsi/be_main.

[PATCH] aic94xx: Add missing error code assignment before test

2016-08-09 Thread Christophe JAILLET
It is likely that checking the result of 'pci_write_config_dword' is expected here. Signed-off-by: Christophe JAILLET <christophe.jail...@wanadoo.fr> --- drivers/scsi/aic94xx/aic94xx_hwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aic94xx/aic94xx_hw

[PATCH] csiostor: Use list_for_each_safe instead of re-implementing it

2015-07-15 Thread Christophe JAILLET
Use 'list_for_each_safe' instead of 'list_for_each' + own logic to keep safe when a list entry is deleted. Delete the now useless 'csio_list_prev' macro. Signed-off-by: Christophe JAILLET christophe.jail...@wanadoo.fr --- drivers/scsi/csiostor/csio_defs.h | 1 - drivers/scsi/csiostor/csio_hw.c

[PATCH] aic7xxx: replace kmalloc/strcpy by kstrdup

2015-07-14 Thread Christophe JAILLET
This replaces kmalloc + strcpy by an equivalent call to kstrdup. Signed-off-by: Christophe JAILLET christophe.jail...@wanadoo.fr --- drivers/scsi/aic7xxx/aic79xx_osm.c | 3 +-- drivers/scsi/aic7xxx/aic7xxx_osm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi

[PATCH v2] aic7xxx: replace kmalloc/strcpy by kstrdup

2015-07-14 Thread Christophe JAILLET
This replaces kmalloc + strcpy by an equivalent call to kstrdup. Signed-off-by: Christophe JAILLET christophe.jail...@wanadoo.fr --- v2: remove useless curly braces drivers/scsi/aic7xxx/aic79xx_osm.c | 6 ++ drivers/scsi/aic7xxx/aic7xxx_osm.c | 6 ++ 2 files changed, 4 insertions(+), 8

[PATCH] arcmsr: Fix a potential data corruption issue

2015-07-09 Thread Christophe JAILLET
Resetting rqbuffer or wqbuffer must be done within a critial section in order to avoir potential data corruption. Signed-off-by: Christophe JAILLET christophe.jail...@wanadoo.fr --- This change is *untested* because I don't have the corresponding hardware. However, it should'nt have any evil side

Re: [PATCH] [SCSI] FlashPoint: optimize string comparison

2015-07-07 Thread Christophe JAILLET
Le 07/07/2015 19:04, Khalid Aziz a écrit : On 07/07/2015 02:45 AM, Frans Klaver wrote: On Tue, Jul 7, 2015 at 7:39 AM, Christophe JAILLET christophe.jail...@wanadoo.fr wrote: Stop comparing the strings as soon as we know that they don't match. Signed-off-by: Christophe JAILLET christophe.jail

[PATCH] [SCSI] FlashPoint: optimize string comparison

2015-07-06 Thread Christophe JAILLET
Stop comparing the strings as soon as we know that they don't match. Signed-off-by: Christophe JAILLET christophe.jail...@wanadoo.fr --- drivers/scsi/FlashPoint.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index