[PATCH] block: bsg.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- block/bsg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bsg.c b/block/bsg.c index ff46add..b2688c5 100644 --- a/block/bsg.c +++ b/block/bsg.c

[PATCH] scsi: bfa: bfad_attr.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfad_attr.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c index 40be670

[PATCH] scsi: ibmvscsi: ibmvscsi.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/ibmvscsi/ibmvscsi.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c

[PATCH] scsi: qla4xxx: ql4_os.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/qla4xxx/ql4_os.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c

[PATCH] scsi: bfa: bfad_bsg.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfad_bsg.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 8994fb8

[PATCH] scsi: mpt2sas: mpt2sas_base.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And removed unnecessary magic numbers. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt2sas/mpt2sas_base.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a

[PATCH] scsi: mpt3sas: mpt3sas_base.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And removed unnecessary magic numbers. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt3sas/mpt3sas_base.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c

[PATCH] scsi: scsi_tgt_if.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-26 Thread Rickard Strandqvist
If you are going to use memset before strncpy you must copy sizeof -1 Signed-off-by: Rickard Strandqvist --- drivers/scsi/scsi_tgt_if.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_tgt_if.c b/drivers/scsi/scsi_tgt_if.c index 6209110..7dc98eb 100644

[PATCH] scsi: qla4xxx: ql4_mbx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-27 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And in some cases modified to copy one character less than the overall length, as the entire area is already zeroed. Signed-off-by: Rickard Strandqvist --- drivers/scsi/qla4xxx/ql4_mbx.c | 14 +++--- 1 file

[PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-27 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And use the sizeof on the to string rather than strlen on the from string. Signed-off-by: Rickard Strandqvist --- drivers/scsi/3w-9xxx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] scsi: bfa: bfa_fcbuild.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-27 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And use the sizeof on the to string rather than strlen on the from string. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfa_fcbuild.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH] scsi: bfa: bfa_fcs_lport.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-27 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. In some cases modified to copy one character less than the overall length, as the entire area is already zeroed. And replacing strncat with strlcat because of incorrect use. Signed-off-by: Rickard Strandqvist --- drivers

[PATCH] scsi: bfa: bfa_fcs.c: Cleaning up missing null-terminate in conjunction with strncpy strncat

2014-07-27 Thread Rickard Strandqvist
Replacing strncp with strlcpy to avoid strings that lacks null terminate. And strncat with strlcat because of incorrect use, removed same the duplicated code. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfa_fcs.c | 80 ++-- 1 file changed

Re: [PATCH] block: bsg.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-29 Thread Rickard Strandqvist
2014-07-28 16:31 GMT+02:00 Jeff Moyer : > Rickard Strandqvist writes: > >> Replacing strncpy with strlcpy to avoid strings that lacks null terminate. >> >> Signed-off-by: Rickard Strandqvist >> --- >> block/bsg.c |2 +- >> 1 file changed, 1 inse

[PATCH] scsi: ch.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-30 Thread Rickard Strandqvist
If you are going to use memset before strncpy you must copy sizeof -1. And removed unnecessary magic numbers. Signed-off-by: Rickard Strandqvist --- drivers/scsi/ch.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index

[PATCH] scsi: csiostor: csio_init.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-30 Thread Rickard Strandqvist
If you use kzalloc before strncpy you must copy sizeof -1. And removed unnecessary magic numbers. Signed-off-by: Rickard Strandqvist --- drivers/scsi/csiostor/csio_init.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi

[PATCH] scsi: hpsa.c: Cleaning up code clarification using strlcpy

2014-07-30 Thread Rickard Strandqvist
Code clarification using strlcpy instead of strncpy. And removed unnecessary memset Signed-off-by: Rickard Strandqvist --- drivers/scsi/hpsa.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 31184b3..814d64d

[PATCH] scsi: ibmvscsi: ibmvfc.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-30 Thread Rickard Strandqvist
And as I understand it, it is fine to replace strncpy to strlcpy here. But if any of this code do not want a null terminated, or want to have the whole rest of size filled with null characters. If that is the case this is not a good patch. Rickard Strandqvist (1): scsi: ibmvscsi: ibmvfc.c

[PATCH] scsi: ibmvscsi: ibmvfc.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-07-30 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/ibmvscsi/ibmvfc.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index

[PATCH] scsi: ibmvscsi: ibmvstgt.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-08-02 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/ibmvscsi/ibmvstgt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index

[PATCH] message: fusion: mptbase.c: Cleaning up missing null-terminate after strncpy call

2014-08-09 Thread Rickard Strandqvist
Added a guaranteed null-terminate after call to strncpy. Signed-off-by: Rickard Strandqvist --- drivers/message/fusion/mptbase.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index ebc0af7..66324f8

[PATCH] scsi: scsi_devinfo.c: Cleaning up unnecessarily complicated in conjunction with strncpy

2014-09-14 Thread Rickard Strandqvist
I have revamped the code so it becomes both more effective and far more clear. Signed-off-by: Rickard Strandqvist --- drivers/scsi/scsi_devinfo.c | 31 +++ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi

[PATCH] scsi: qla2xxx: qla_gs.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-09-14 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/qla2xxx/qla_gs.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi

[PATCH] scsi: qla2xxx: qla_mr.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-09-14 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/scsi/qla2xxx/qla_mr.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c

Re: [PATCH] scsi: scsi_devinfo.c: Cleaning up unnecessarily complicated in conjunction with strncpy

2014-09-14 Thread Rickard Strandqvist
2014-09-14 23:34 GMT+02:00 Elliott, Robert (Server Storage) : > > >> -Original Message- >> From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- >> ow...@vger.kernel.org] On Behalf Of Rickard Strandqvist > ... >> diff --git a/drivers/scsi/scsi_devinf

Re: [PATCH] scsi: scsi_devinfo.c: Cleaning up unnecessarily complicated in conjunction with strncpy

2014-09-15 Thread Rickard Strandqvist
2014-09-15 0:38 GMT+02:00 Elliott, Robert (Server Storage) : > > >> -Original Message----- >> From: Rickard Strandqvist [mailto:rickard_strandqv...@spectrumdigital.se] >> How do you mean? >> >> strncpy zeroes throughout the remainder of the string "fr

[PATCH] message: fusion: mptscsih.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/message/fusion/mptscsih.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH] scsi: bfa: bfa_fcs_lport.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfa_fcs_lport.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] scsi: bnx2i: bnx2i_iscsi.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bnx2i/bnx2i_iscsi.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

[PATCH] scsi: dc395x.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/dc395x.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/dc395x.c

[PATCH] scsi: mpt2sas: mpt2sas_base.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt2sas/mpt2sas_base.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH] scsi: mvsas: mv_sas.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mvsas/mv_sas.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions

[PATCH] scsi: pm8001: pm8001_hwi.c: Fix for possible null pointer dereference

2014-05-18 Thread Rickard Strandqvist
There is otherwise a risk of a possible null pointer dereference. Was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/pm8001/pm8001_hwi.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH] scsi: dc395x.c: Fix for possible null pointer dereference

2014-05-20 Thread Rickard Strandqvist
Okay, good! Or, do I need to do anything else :-) Best regards Rickard Strandqvist 2014-05-19 13:39 GMT+02:00 Oliver Neukum : > On Sun, 2014-05-18 at 21:50 +0200, Guennadi Liakhovetski wrote: >> On Sun, 18 May 2014, Rickard Strandqvist wrote: >> >> > There is otherwise a

Re: [PATCH] scsi: pm8001: pm8001_hwi.c: Fix for possible null pointer dereference

2014-05-29 Thread Rickard Strandqvist
Hi Quite rightly, this is what cppcheck reacts. Ok, I'll send a patch for that instead then. Best regards Rickard Strandqvist 2014-05-28 13:38 GMT+02:00 Tomas Henzl : > On 05/28/2014 01:28 PM, Christoph Hellwig wrote: >> On Sun, May 18, 2014 at 06:14:00PM +0200, Rickard Str

[PATCH] scsi: pm8001: pm8001_hwi.c: Fix to remove null pointer checks that could never happen

2014-05-29 Thread Rickard Strandqvist
Removal of null pointer checks that could never happen Signed-off-by: Rickard Strandqvist --- drivers/scsi/pm8001/pm8001_hwi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index a97be01..721d059 100644

[PATCH] scsi: advansys.c: Cleaning up uninitialized variables

2014-06-01 Thread Rickard Strandqvist
There is a risk that the variable will be used without being initialized. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/advansys.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH] scsi: mpt3sas: mpt3sas_transport.c: Cleaning up uninitialized variables

2014-06-01 Thread Rickard Strandqvist
There is a risk that the variable will be used without being initialized. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt3sas/mpt3sas_transport.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions

[PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up uninitialized variables

2014-06-01 Thread Rickard Strandqvist
There is a risk that the variable will be used without being initialized. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/pm8001/pm80xx_hwi.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH] scsi: sun3_NCR5380.c: Cleaning up uninitialized variables

2014-06-01 Thread Rickard Strandqvist
There is a risk that the variable will be used without being initialized. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/sun3_NCR5380.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH] scsi: bfa: bfad_attr.c: Optimization of the Code

2014-06-04 Thread Rickard Strandqvist
Minimized the use of snprintf() And removed a variable that was only used for the temporary storage. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfad_attr.c | 14 -- 1 file changed, 8

[PATCH] scsi: bfa: bfad_attr.c: Cleaning up missing null-terminate after strncpy call

2014-06-04 Thread Rickard Strandqvist
Added a guaranteed null-terminate after call to strncpy. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfad_attr.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/bfa

[PATCH] scsi: ibmvscsi: ibmvscsi.c: Cleaning up missing null-terminate after strncpy call

2014-06-04 Thread Rickard Strandqvist
Added a guaranteed null-terminate after call to strncpy. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/ibmvscsi/ibmvscsi.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH] scsi: mpt2sas: mpt2sas_base.c: Cleaning up missing null-terminate after strncpy call

2014-06-04 Thread Rickard Strandqvist
Added a guaranteed null-terminate after call to strncpy. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt2sas/mpt2sas_base.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH] scsi: mpt3sas: mpt3sas_base.c: Cleaning up missing null-terminate after strncpy call

2014-06-04 Thread Rickard Strandqvist
Added a guaranteed null-terminate after call to strncpy. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt3sas/mpt3sas_base.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi

Re: [PATCH] scsi: mpt2sas: mpt2sas_base.c: Cleaning up missing null-terminate after strncpy call

2014-06-04 Thread Rickard Strandqvist
Hi A little embarrassing, but I actually did not know that there was a better replacement for strncpy. Sorry, but I will send a new platch based on strlcpy instead then. Will investigate cover letter then to. Best regards Rickard Strandqvist 2014-06-05 0:01 GMT+02:00 Joe Perches : > On

Re: [PATCH] scsi: bfa: bfad_attr.c: Cleaning up missing null-terminate after strncpy call

2014-06-06 Thread Rickard Strandqvist
whole incoming struct. But the only thing that is done then is a: strncpy(port_attr->port_sym_name.symname, (char *)&bfa_fcs_lport_get_psym_name(port), BFA_SYMNAME_MAXLEN); Thus not having BFA_SYMNAME_MAXLEN -1 that would be a solution. Best regards Rickard Strandqvist 201

Re: [PATCH] scsi: mpt2sas: mpt2sas_base.c: Cleaning up missing null-terminate after strncpy call

2014-06-06 Thread Rickard Strandqvist
switch to strcpy outright. So what happens now? Should I make a new patch, with strlcpy or just straight off with strcpy then? Best regards Rickard Strandqvist 2014-06-05 0:28 GMT+02:00 James Bottomley : > On Wed, 2014-06-04 at 23:36 +0200, Rickard Strandqvist wrote: >> Added a guaran

[PATCH] scsi: bfa: bfad_attr.c: Optimization of the code

2014-06-06 Thread Rickard Strandqvist
Minimized the use of snprintf() And removed a variable that was only used for the temporary storage. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfad_attr.c | 114 -- 1 file changed, 66 insertions(+), 48 deletions(-) diff --git a/drivers

Re: [PATCH] scsi: bfa: bfad_attr.c: Optimization of the Code

2014-06-06 Thread Rickard Strandqvist
snprintf to strlcpy. Best regards Rickard Strandqvist 2014-06-05 9:10 GMT+02:00 Bart Van Assche : > On 06/05/14 08:55, Bart Van Assche wrote: >> On 06/04/14 20:08, Rickard Strandqvist wrote: >> This is ugly. Please use sprintf(buf, "%.*s\n", PAGE_SIZE - 1, str) >>

[PATCH] scsi: mpt2sas: mpt2sas_base.c: Cleaning up wrong return value

2014-06-07 Thread Rickard Strandqvist
A variable to manage the error code is not returned. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt2sas/mpt2sas_base.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH] scsi: mpt3sas: mpt3sas_base.c: Cleaning up wrong return value

2014-06-07 Thread Rickard Strandqvist
A variable to manage the error code is not returned. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/mpt3sas/mpt3sas_base.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH] scsi: advansys.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
A struct member variable is set to the same value more than once This was found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/advansys.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi

[PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/scsi/pm8001/pm80xx_hwi.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi

[PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/scsi/bnx2i/bnx2i_iscsi.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi

Re: [PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-25 Thread Rickard Strandqvist
2014-06-25 19:13 GMT+02:00 Eddie Wai : > On Wed, 2014-06-25 at 16:26 +0200, Maurizio Lombardi wrote: >> Hi, >> >> On 06/25/2014 04:04 PM, Rickard Strandqvist wrote: >> > A struct member variable is set to different values without having used in >> > be

[PATCH v2] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-26 Thread Rickard Strandqvist
A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/scsi/bnx2i/bnx2i_iscsi.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH v3] scsi: bnx2i: bnx2i_iscsi.c: Fix variable which was set to the wrong value

2014-06-26 Thread Rickard Strandqvist
After some discussion, all agreed that the previous value was incorrect. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bnx2i/bnx2i_iscsi.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index

Re: [PATCH] scsi: mpt2sas: mpt2sas_base.c: Fix for possible null pointer dereference

2014-07-03 Thread Rickard Strandqvist
#x27;ve done quite a few more patches that there should not have been any {} And then, it is perhaps good to sett a start value for ioc_status. My suggestion is: u16 ioc_status = MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED; Kind regards Rickard Strandqvist -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] target: iscsi: iscsi_target_tpg.c: Cleaning up possible size overwriting in conjunction with sprintf

2014-10-12 Thread Rickard Strandqvist
Changed same snprintf and sprintf to strlcpy and strlcat. This will guarantee that the string size is not overwritten, and they are significantly faster than sprintf also. Signed-off-by: Rickard Strandqvist --- drivers/target/iscsi/iscsi_target_tpg.c | 16 +++- 1 file changed, 7

Re: [PATCH] target: iscsi: iscsi_target_tpg.c: Cleaning up possible size overwriting in conjunction with sprintf

2014-10-12 Thread Rickard Strandqvist
2014-10-12 20:18 GMT+02:00 Joe Perches : > On Sun, 2014-10-12 at 19:55 +0200, Rickard Strandqvist wrote: >> Changed same snprintf and sprintf to strlcpy and strlcat. >> This will guarantee that the string size is not overwritten, >> and they are significantly faster than spri

[PATCH 2/5] scsi: bfa: bfa_fcs_lport.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-18 Thread Rickard Strandqvist
Ensures that the string is null-terminate in connection with the use of strncpy, by switching from strncpy to strzcpy. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfa_fcs_lport.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c

Re: [PATCH 2/5] scsi: bfa: bfa_fcs_lport.c: Cleaning up missing null-terminate by switching from strncpy to strzcpy

2014-10-20 Thread Rickard Strandqvist
2014-10-20 17:37 GMT+02:00 Dan Carpenter : > On Sun, Oct 19, 2014 at 12:13:10AM +0200, Rickard Strandqvist wrote: >> Ensures that the string is null-terminate in connection with the >> use of strncpy, by switching from strncpy to strzcpy. >> > > I wish the changelogs w

[PATCH] scsi: bfa: bfa_fcpim.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
Remove the function bfa_tskim_iodone() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfa_fcpim.c |9 - drivers/scsi/bfa/bfa_fcpim.h |1 - 2 files changed, 10

[PATCH] scsi: bfa: bfa_fcbuild.c: Remove some unused functions

2014-12-07 Thread Rickard Strandqvist
() fc_rrq_rsp_parse() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfa_fcbuild.c | 607 drivers/scsi/bfa/bfa_fcbuild.h | 87 -- 2 files changed, 694 deletions

[PATCH] scsi: bfa: bfad.c: Remove unused function

2014-12-07 Thread Rickard Strandqvist
Remove the function bfad_drv_uninit() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bfa/bfad.c | 20 drivers/scsi/bfa/bfad_drv.h |1 - 2 files

[PATCH] scsi: arm: cumana_1.c: Remove unused function

2014-12-20 Thread Rickard Strandqvist
Remove the function cumanascsi_setup() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/arm/cumana_1.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/arm

Re: [PATCH] scsi: arm: cumana_1.c: Remove unused function

2014-12-20 Thread Rickard Strandqvist
2014-12-20 17:50 GMT+01:00 Jeremiah Mahler : > On Sat, Dec 20, 2014 at 05:36:15PM +0100, Rickard Strandqvist wrote: >> Remove the function cumanascsi_setup() that is not used anywhere. >> >> This was partially found by using a static code analysis program called >> cp

[PATCH] scsi: gdth_proc.c: Remove unused function

2014-12-20 Thread Rickard Strandqvist
Remove the function gdth_ioctl_check_bin() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/gdth_proc.c | 18 -- 1 file changed, 18 deletions(-) diff --git a

Re: [PATCH] scsi: 3w-9xxx.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-12-22 Thread Rickard Strandqvist
2014-08-01 0:19 GMT+02:00 adam radford : > On Sun, Jul 27, 2014 at 8:11 AM, Rickard Strandqvist > wrote: >> Replacing strncpy with strlcpy to avoid strings that lacks null terminate. >> And use the sizeof on the to string rather than strlen on the from string. >> &

[PATCH] scsi: cxgbi: libcxgbi.c: Remove some unused functions

2015-01-01 Thread Rickard Strandqvist
Removes some functions that are not used anywhere: csk_print_ip() csk_print_port() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/cxgbi/libcxgbi.c | 28 1 file changed, 28

[PATCH] scsi: aic7xxx: aic7770: Remove unused function

2015-01-02 Thread Rickard Strandqvist
Remove the function aic7770_find_device() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/aic7xxx/aic7770.c | 14 -- drivers/scsi/aic7xxx/aic7xxx.h |1 - 2 files

[PATCH] scsi: aic7xxx: aic7xxx_core: Remove some unused functions

2015-01-03 Thread Rickard Strandqvist
Removes some functions that are not used anywhere: ahc_outq() ahc_inq() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/scsi/aic7xxx/aic7xxx_core.c | 26 -- drivers/scsi/aic7xxx