Re: [PATCH] scsi: hisi_sas: fix free'ing in probe and remove

2016-12-02 Thread Quentin Lambert
n.ga...@huawei.com> Reviewed-by: Quentin Lambert <lambert.quen...@gmail.com> diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 6d6f150..d50e9cf 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1412,

Re: [patch] scsi: dpt_i2o: double free on error path

2016-11-30 Thread Quentin Lambert
On 11/30/2016 08:36 PM, Dan Carpenter wrote: We recently introduced a kfree() in the caller for this function. That's where, logically, you would think the kfree() should be. Unfortunately the code was just ugly and not buggy so the static checker warning was a false postive and introduced a

[PATCH v2] scsi: aic94xx: Add a missing call to kfree

2016-11-25 Thread Quentin Lambert
Most error branches following the call to kzalloc contain a call to kfree. This patch add these calls where they are missing and set the relevant pointers to NULL. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- v2: set the point to NULL

Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree

2016-11-21 Thread Quentin Lambert
On 11/21/2016 03:16 PM, John Garry wrote: On 21/11/2016 13:20, Quentin Lambert wrote: On 11/21/2016 01:53 PM, John Garry wrote: However I have noticed that we should do a call to hisi_sas_free() for this failure, and later failures in the probe. I don't understand why, and would welcome

Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree

2016-11-21 Thread Quentin Lambert
On 11/21/2016 01:53 PM, John Garry wrote: However I have noticed that we should do a call to hisi_sas_free() for this failure, and later failures in the probe. I don't understand why, and would welcome the opportunity to learn something. Quentin -- To unsubscribe from this list: send the

[PATCH] xen-scsifront: Add a missing call to kfree

2016-11-19 Thread Quentin Lambert
Most error branches following the call to kmalloc contain a call to kfree. This patch add these calls where they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/xen-scsifront.c |1 + 1 file changed, 1 ins

[PATCH] [SCSI] dpt_i2o: Add a missing call to kfree

2016-11-19 Thread Quentin Lambert
Most error branches following the call to kzalloc contain a call to kfree. This patch add these calls where they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/dpt_i2o.c |4 +++- 1 file changed, 3 insertions

[PATCH] scsi: pmcraid: Add missing resource releases

2016-11-19 Thread Quentin Lambert
they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/pmcraid.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3787,11 +3787,11 @@ stati

[PATCH] isci: Add a missing call to pci_unmap_biosrom

2016-11-19 Thread Quentin Lambert
Most error branches following the call to pci_map_biosrom contain a call to pci_unmap_biosrom. This patch add these calls where they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/isci/probe_roms.c |1 +

[PATCH] scsi: hisi_sas: Add a missing call to kfree

2016-11-19 Thread Quentin Lambert
Most error branches following the call to hisi_sas_shost_alloc contain a call to kfree. This patch add these calls where they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/hisi_sas/hisi_sas_main.c |6 +++

[PATCH] cxgb4i: Add a missing call to neigh_release

2016-11-19 Thread Quentin Lambert
Most error branches following the call to dst_neigh_lookup contain a call to neigh_release. This patch add these calls where they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/cxgbi/cxgb4i/cxgb4i.c |2 +-

[PATCH] scsi: aic94xx: Add a missing call to kfree

2016-11-19 Thread Quentin Lambert
Most error branches following the call to kzalloc contain a call to kfree. This patch add these calls where they are missing. This issue was found with Hector. Signed-off-by: Quentin Lambert <lambert.quen...@gmail.com> --- drivers/scsi/aic94xx/aic94xx_hwi.c |4 +++- 1 file chan

[PATCH 0/3] Minor clean up in mpt2sas

2014-12-19 Thread Quentin Lambert
of the loop. It now uses a break statement to exit it. The third patch simplifies an unnecesary complicated use of a boolean variable. Quentin Lambert (3): [SCSI] mpt2sas: Merge two similar functions [SCSI] mpt2sas: Simplify the code of mpt2sas_scsih_tm_flag [SCSI] mpt2sas: Remove

[PATCH 1/3] [SCSI] mpt2sas: Merge two similar functions

2014-12-19 Thread Quentin Lambert
mpt2sas_scsih_set_tm_flag and mpt2sas_scsih_clear_tm_flag shared a lot of code. Therefore, they are merged into one function whose behaviour is given by a new parameter named action. Signed-off-by: Quentin Lambert lambert.quen...@gmail.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 43

[PATCH 2/3] [SCSI] mpt2sas: Simplify the code of mpt2sas_scsih_tm_flag

2014-12-19 Thread Quentin Lambert
Since skip was only used to pass through the rest of the loop, a break statment is called where skip was previously assigned 1. Signed-off-by: Quentin Lambert lambert.quen...@gmail.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH 3/3] [SCSI] mpt2sas: Remove unnecessary use of a boolean variable

2014-12-19 Thread Quentin Lambert
Signed-off-by: Quentin Lambert lambert.quen...@gmail.com --- drivers/scsi/mpt2sas/mpt2sas_base.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 58e4521..c31de9d 100644 --- a/drivers/scsi

[PATCH v2 0/3] Minor clean up in mpt2sas

2014-12-19 Thread Quentin Lambert
The version 2 of this patch fix the logic error pointed out by Joe Perches. Quentin Lambert (3): [SCSI] mpt2sas: Merge two similar functions [SCSI] mpt2sas: Simplify the code of mpt2sas_scsih_tm_flag [SCSI] mpt2sas: Remove unnecessary use of a boolean variable drivers/scsi/mpt2sas

[PATCH v2 1/3] [SCSI] mpt2sas: Merge two similar functions

2014-12-19 Thread Quentin Lambert
mpt2sas_scsih_set_tm_flag and mpt2sas_scsih_clear_tm_flag shared a lot of code. Therefore, they are merged into one function whose behaviour is given by a new parameter named action. Signed-off-by: Quentin Lambert lambert.quen...@gmail.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 43

[PATCH v2 2/3] [SCSI] mpt2sas: Simplify the code of mpt2sas_scsih_tm_flag

2014-12-19 Thread Quentin Lambert
Since skip was only used to pass through the rest of the loop, a break statment is called where skip was previously assigned 1. Signed-off-by: Quentin Lambert lambert.quen...@gmail.com --- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH v2 3/3] [SCSI] mpt2sas: Remove unnecessary use of a boolean variable

2014-12-19 Thread Quentin Lambert
Signed-off-by: Quentin Lambert lambert.quen...@gmail.com --- drivers/scsi/mpt2sas/mpt2sas_base.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 58e4521..6cc0591 100644 --- a/drivers/scsi

[PATCH v2 0/1] int to bool conversion

2014-12-19 Thread Quentin Lambert
/linux-kernel-janitors/msg20627.html Quentin Lambert (1): [SCSI] mpt2sas: Convert non-returned local variable to boolean when relevant drivers/scsi/mpt2sas/mpt2sas_base.c | 12 ++-- drivers/scsi/mpt2sas/mpt2sas_config.c| 5 +++-- drivers/scsi/mpt2sas/mpt2sas_ctl.c

[PATCH v2 1/1] [SCSI] mpt2sas: Convert non-returned local variable to boolean when relevant

2014-12-19 Thread Quentin Lambert
expression e1 != {0, 1}, e2; @@ f(...) { ...when any ( x = e1; | x + e2 ) ...when any } @depends on !bad@ identifier r.f; local idexpression u8 r.x; identifier r.xname; @@ f(...) { ... ++ bool xname; - int xname; ... ( x = - 1 + true | x = - -1 + false ) ... } Signed-off-by: Quentin Lambert

[PATCH 0/1] int to bool conversion

2014-12-17 Thread Quentin Lambert
This patch converts local variable declared as integer and used as boolean into actual booleans. It only patches variables that are not returned to limit the scope of the changes. This patch was generated with Coccinelle using the semantic patch below. Quentin Lambert (1): [SCSI] mpt2sas

[PATCH 1/1] [SCSI] mpt2sas: Convert non-returned local variable to boolean when relevant

2014-12-17 Thread Quentin Lambert
expression e1 != {0, 1}, e2; @@ f(...) { ...when any ( x = e1; | x + e2 ) ...when any } @depends on !bad@ identifier r.f; local idexpression u8 r.x; identifier r.xname; @@ f(...) { ... ++ bool xname; - int xname; ... ( x = - 1 + true | x = - -1 + false ) ... } Signed-off-by: Quentin Lambert