Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1320344
| From | Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects |
| Date | 2016-01-28 07:40 +0100 |
| Message-ID | <qVOpl-7Sk-35@gated-at.bofh.it> (permalink) |
| References | <qVOpj-7Sk-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> 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> --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 3 ++- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++-- drivers/scsi/mpt3sas/mpt3sas_transport.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index ef9971e..d872587 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -401,7 +401,8 @@ mpt3sas_ctl_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, Mpi2EventNotificationReply_t *mpi_reply; mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply); - mpt3sas_ctl_add_to_event_log(ioc, mpi_reply); + if (mpi_reply) + mpt3sas_ctl_add_to_event_log(ioc, mpi_reply); return 1; } diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 0fb4ccd..686a46a 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2399,7 +2399,7 @@ _scsih_tm_display_info(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd) (unsigned long long) sas_device->enclosure_logical_id, sas_device->slot); - if (sas_device->connector_name) + if (sas_device->connector_name[0] != '\0') starget_printk(KERN_INFO, starget, "enclosure level(0x%04x),connector name(%s)\n", sas_device->enclosure_level, @@ -3134,7 +3134,7 @@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTER *ioc, u16 handle) " slot(%d)\n", ioc->name, (unsigned long long) sas_device->enclosure_logical_id, sas_device->slot)); - if (sas_device->connector_name) + if (sas_device->connector_name[0] != '\0') dewtprintk(ioc, pr_info(MPT3SAS_FMT "setting delete flag: enclosure level(0x%04x)," " connector name( %s)\n", ioc->name, diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index df08aeb..6a84b82 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; -- 1.8.3.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[mpt3sas driver patches 00/10] mpt3sas driver enhancements and Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:40 +0100
[mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:40 +0100
Re: [mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:20 +0100
[mpt3sas driver 05/10] mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:40 +0100
[mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:50 +0100
Re: [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. Christoph Hellwig <hch@infradead.org> - 2016-01-28 10:20 +0100
Re: [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message. Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:20 +0100
[mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device Suganath prabu Subaramani <suganath-prabu.subramani@avagotech.com> - 2016-01-28 07:50 +0100
Re: [mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:40 +0100
Re: [mpt3sas driver 01/10] mpt3sas: Added support for high port count HBA variants. Tomas Henzl <thenzl@redhat.com> - 2016-02-04 15:20 +0100
Re: [mpt3sas driver patches 00/10] mpt3sas driver enhancements and "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-02-05 03:10 +0100
csiph-web