mpt3sas: Fix static analyzer(coverity) tool identified defects
authorSuganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Thu, 28 Jan 2016 06:37:00 +0000 (12:07 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Feb 2016 02:27:02 +0000 (21:27 -0500)
commit869817f9e92e3b7911053e3c346560f20219e837
treeffb71c07de6def18b0a0546b9ec0753e2f344f67
parentce61c574275651d964cf466469473726cb0e548f
mpt3sas: Fix static analyzer(coverity) tool identified defects

1.Wrong size of argument is being passed
 The size of struct being passed as an argument to memset func and area of
 memory being pointed by an instance of struct in memset func should be of
 same structure type.
2.Dereference null return value
3.Array compared against '0'
 Check whether value pointed by particular index of an array is null or not
 in "if" statement.

Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_ctl.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/mpt3sas/mpt3sas_transport.c