diff options
author | Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> | 2016-01-28 09:37:00 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-02-24 05:27:02 +0300 |
commit | 869817f9e92e3b7911053e3c346560f20219e837 (patch) | |
tree | ffb71c07de6def18b0a0546b9ec0753e2f344f67 /drivers/scsi/mpt3sas/mpt3sas_transport.c | |
parent | ce61c574275651d964cf466469473726cb0e548f (diff) | |
download | linux-869817f9e92e3b7911053e3c346560f20219e837.tar.xz |
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>
Diffstat (limited to 'drivers/scsi/mpt3sas/mpt3sas_transport.c')
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index df08aeb5dbd4..6a84b82d71bb 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1600,7 +1600,7 @@ _transport_phy_reset(struct sas_phy *phy, int hard_reset) SMP_PHY_CONTROL_LINK_RESET); /* handle hba phys */ - memset(&mpi_request, 0, sizeof(Mpi2SasIoUnitControlReply_t)); + memset(&mpi_request, 0, sizeof(Mpi2SasIoUnitControlRequest_t)); mpi_request.Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; mpi_request.Operation = hard_reset ? MPI2_SAS_OP_PHY_HARD_RESET : MPI2_SAS_OP_PHY_LINK_RESET; |