aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_ctl.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_ctl.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_ctl.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_ctl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index 850bb9da7cd8..49bdd2dc8452 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -865,8 +865,16 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, struct mpt2_ioctl_command karg,
865 if (smp_request->PassthroughFlags & 865 if (smp_request->PassthroughFlags &
866 MPI2_SMP_PT_REQ_PT_FLAGS_IMMEDIATE) 866 MPI2_SMP_PT_REQ_PT_FLAGS_IMMEDIATE)
867 data = (u8 *)&smp_request->SGL; 867 data = (u8 *)&smp_request->SGL;
868 else 868 else {
869 if (unlikely(data_out == NULL)) {
870 printk(KERN_ERR "failure at %s:%d/%s()!\n",
871 __FILE__, __LINE__, __func__);
872 mpt2sas_base_free_smid(ioc, smid);
873 ret = -EINVAL;
874 goto out;
875 }
869 data = data_out; 876 data = data_out;
877 }
870 878
871 if (data[1] == 0x91 && (data[10] == 1 || data[10] == 2)) { 879 if (data[1] == 0x91 && (data[10] == 1 || data[10] == 2)) {
872 ioc->ioc_link_reset_in_progress = 1; 880 ioc->ioc_link_reset_in_progress = 1;
@@ -2832,7 +2840,7 @@ _ctl_host_trace_buffer_enable_store(struct device *cdev,
2832 struct mpt2_diag_register diag_register; 2840 struct mpt2_diag_register diag_register;
2833 u8 issue_reset = 0; 2841 u8 issue_reset = 0;
2834 2842
2835 if (sscanf(buf, "%s", str) != 1) 2843 if (sscanf(buf, "%9s", str) != 1)
2836 return -EINVAL; 2844 return -EINVAL;
2837 2845
2838 if (!strcmp(str, "post")) { 2846 if (!strcmp(str, "post")) {