aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_base.c
diff options
context:
space:
mode:
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>2012-03-20 02:37:17 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-04-23 14:27:21 -0400
commit298c794def0631763ec861e641a448c7decf73bb (patch)
treef22b4ccd7cab935907505322dd0eab330c96a480 /drivers/scsi/mpt2sas/mpt2sas_base.c
parent09da0b32d078a3b94aa6d948d053b84755712a2b (diff)
[SCSI] mpt2sas: Fix security scan issues reported by source code analysis tool
Modified the source code as per the findings reported by the source code analysis tool. Source code for the following functionalities has been touched. None of the driver functionalities has changed. - SMP Passthrough IOCTL - Debug messages for MPT Replies (i.e. bit 9 of Logging Level) - Task Management using sysfs - Device removal, i.e. when a target device (including any PD within a volume) is removed, and Volume Deletion. - Trace Buffer Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 30d540a05ad8..f162db3a0c05 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -699,6 +699,11 @@ _base_display_reply_info(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
699 u16 ioc_status; 699 u16 ioc_status;
700 700
701 mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply); 701 mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply);
702 if (unlikely(!mpi_reply)) {
703 printk(MPT2SAS_ERR_FMT "mpi_reply not valid at %s:%d/%s()!\n",
704 ioc->name, __FILE__, __LINE__, __func__);
705 return;
706 }
702 ioc_status = le16_to_cpu(mpi_reply->IOCStatus); 707 ioc_status = le16_to_cpu(mpi_reply->IOCStatus);
703#ifdef CONFIG_SCSI_MPT2SAS_LOGGING 708#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
704 if ((ioc_status & MPI2_IOCSTATUS_MASK) && 709 if ((ioc_status & MPI2_IOCSTATUS_MASK) &&
@@ -930,16 +935,18 @@ _base_interrupt(int irq, void *bus_id)
930 else if (request_desript_type == 935 else if (request_desript_type ==
931 MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS) 936 MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS)
932 goto next; 937 goto next;
933 if (smid) 938 if (smid) {
934 cb_idx = _base_get_cb_idx(ioc, smid); 939 cb_idx = _base_get_cb_idx(ioc, smid);
935 if (smid && cb_idx != 0xFF) { 940 if ((likely(cb_idx < MPT_MAX_CALLBACKS))
936 rc = mpt_callbacks[cb_idx](ioc, smid, msix_index, 941 && (likely(mpt_callbacks[cb_idx] != NULL))) {
937 reply); 942 rc = mpt_callbacks[cb_idx](ioc, smid,
943 msix_index, reply);
938 if (reply) 944 if (reply)
939 _base_display_reply_info(ioc, smid, msix_index, 945 _base_display_reply_info(ioc, smid,
940 reply); 946 msix_index, reply);
941 if (rc) 947 if (rc)
942 mpt2sas_base_free_smid(ioc, smid); 948 mpt2sas_base_free_smid(ioc, smid);
949 }
943 } 950 }
944 if (!smid) 951 if (!smid)
945 _base_async_event(ioc, msix_index, reply); 952 _base_async_event(ioc, msix_index, reply);