aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/53c7xx.c4
-rw-r--r--drivers/scsi/ch.c29
-rw-r--r--drivers/scsi/cpqfcTSinit.c3
-rw-r--r--drivers/scsi/ibmmca.c1
-rw-r--r--drivers/scsi/osst.c13
-rw-r--r--drivers/scsi/pluto.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c2
7 files changed, 26 insertions, 29 deletions
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index 2341d27ceed7..7a33c708f5b3 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -6090,8 +6090,8 @@ NCR53c7x0_release(struct Scsi_Host *host) {
6090 if (hostdata->num_cmds) 6090 if (hostdata->num_cmds)
6091 printk ("scsi%d : leaked %d NCR53c7x0_cmd structures\n", 6091 printk ("scsi%d : leaked %d NCR53c7x0_cmd structures\n",
6092 host->host_no, hostdata->num_cmds); 6092 host->host_no, hostdata->num_cmds);
6093 if (hostdata->events) 6093
6094 vfree ((void *)hostdata->events); 6094 vfree(hostdata->events);
6095 6095
6096 /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING, which 6096 /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING, which
6097 * XXX may be invalid (CONFIG_060_WRITETHROUGH) 6097 * XXX may be invalid (CONFIG_060_WRITETHROUGH)
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index bd0e1b6be1ea..da6e51c7fe69 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -116,7 +116,7 @@ typedef struct {
116} scsi_changer; 116} scsi_changer;
117 117
118static LIST_HEAD(ch_devlist); 118static LIST_HEAD(ch_devlist);
119static spinlock_t ch_devlist_lock = SPIN_LOCK_UNLOCKED; 119static DEFINE_SPINLOCK(ch_devlist_lock);
120static int ch_devcount; 120static int ch_devcount;
121 121
122static struct scsi_driver ch_template = 122static struct scsi_driver ch_template =
@@ -560,7 +560,7 @@ ch_set_voltag(scsi_changer *ch, u_int elem,
560 return result; 560 return result;
561} 561}
562 562
563static int ch_gstatus(scsi_changer *ch, int type, unsigned char *dest) 563static int ch_gstatus(scsi_changer *ch, int type, unsigned char __user *dest)
564{ 564{
565 int retval = 0; 565 int retval = 0;
566 u_char data[16]; 566 u_char data[16];
@@ -634,6 +634,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
634{ 634{
635 scsi_changer *ch = file->private_data; 635 scsi_changer *ch = file->private_data;
636 int retval; 636 int retval;
637 void __user *argp = (void __user *)arg;
637 638
638 switch (cmd) { 639 switch (cmd) {
639 case CHIOGPARAMS: 640 case CHIOGPARAMS:
@@ -646,7 +647,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
646 params.cp_nportals = ch->counts[CHET_IE]; 647 params.cp_nportals = ch->counts[CHET_IE];
647 params.cp_ndrives = ch->counts[CHET_DT]; 648 params.cp_ndrives = ch->counts[CHET_DT];
648 649
649 if (copy_to_user((void *) arg, &params, sizeof(params))) 650 if (copy_to_user(argp, &params, sizeof(params)))
650 return -EFAULT; 651 return -EFAULT;
651 return 0; 652 return 0;
652 } 653 }
@@ -671,7 +672,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
671 vparams.cvp_n4 = ch->counts[CHET_V4]; 672 vparams.cvp_n4 = ch->counts[CHET_V4];
672 strncpy(vparams.cvp_label4,vendor_labels[3],16); 673 strncpy(vparams.cvp_label4,vendor_labels[3],16);
673 } 674 }
674 if (copy_to_user((void *) arg, &vparams, sizeof(vparams))) 675 if (copy_to_user(argp, &vparams, sizeof(vparams)))
675 return -EFAULT; 676 return -EFAULT;
676 return 0; 677 return 0;
677 } 678 }
@@ -680,7 +681,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
680 { 681 {
681 struct changer_position pos; 682 struct changer_position pos;
682 683
683 if (copy_from_user(&pos, (void*)arg, sizeof (pos))) 684 if (copy_from_user(&pos, argp, sizeof (pos)))
684 return -EFAULT; 685 return -EFAULT;
685 686
686 if (0 != ch_checkrange(ch, pos.cp_type, pos.cp_unit)) { 687 if (0 != ch_checkrange(ch, pos.cp_type, pos.cp_unit)) {
@@ -699,7 +700,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
699 { 700 {
700 struct changer_move mv; 701 struct changer_move mv;
701 702
702 if (copy_from_user(&mv, (void*)arg, sizeof (mv))) 703 if (copy_from_user(&mv, argp, sizeof (mv)))
703 return -EFAULT; 704 return -EFAULT;
704 705
705 if (0 != ch_checkrange(ch, mv.cm_fromtype, mv.cm_fromunit) || 706 if (0 != ch_checkrange(ch, mv.cm_fromtype, mv.cm_fromunit) ||
@@ -721,7 +722,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
721 { 722 {
722 struct changer_exchange mv; 723 struct changer_exchange mv;
723 724
724 if (copy_from_user(&mv, (void*)arg, sizeof (mv))) 725 if (copy_from_user(&mv, argp, sizeof (mv)))
725 return -EFAULT; 726 return -EFAULT;
726 727
727 if (0 != ch_checkrange(ch, mv.ce_srctype, mv.ce_srcunit ) || 728 if (0 != ch_checkrange(ch, mv.ce_srctype, mv.ce_srcunit ) ||
@@ -746,7 +747,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
746 { 747 {
747 struct changer_element_status ces; 748 struct changer_element_status ces;
748 749
749 if (copy_from_user(&ces, (void*)arg, sizeof (ces))) 750 if (copy_from_user(&ces, argp, sizeof (ces)))
750 return -EFAULT; 751 return -EFAULT;
751 if (ces.ces_type < 0 || ces.ces_type >= CH_TYPES) 752 if (ces.ces_type < 0 || ces.ces_type >= CH_TYPES)
752 return -EINVAL; 753 return -EINVAL;
@@ -762,7 +763,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
762 unsigned int elem; 763 unsigned int elem;
763 int result,i; 764 int result,i;
764 765
765 if (copy_from_user(&cge, (void*)arg, sizeof (cge))) 766 if (copy_from_user(&cge, argp, sizeof (cge)))
766 return -EFAULT; 767 return -EFAULT;
767 768
768 if (0 != ch_checkrange(ch, cge.cge_type, cge.cge_unit)) 769 if (0 != ch_checkrange(ch, cge.cge_type, cge.cge_unit))
@@ -825,7 +826,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
825 kfree(buffer); 826 kfree(buffer);
826 up(&ch->lock); 827 up(&ch->lock);
827 828
828 if (copy_to_user((void*)arg, &cge, sizeof (cge))) 829 if (copy_to_user(argp, &cge, sizeof (cge)))
829 return -EFAULT; 830 return -EFAULT;
830 return result; 831 return result;
831 } 832 }
@@ -843,7 +844,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
843 struct changer_set_voltag csv; 844 struct changer_set_voltag csv;
844 int elem; 845 int elem;
845 846
846 if (copy_from_user(&csv, (void*)arg, sizeof(csv))) 847 if (copy_from_user(&csv, argp, sizeof(csv)))
847 return -EFAULT; 848 return -EFAULT;
848 849
849 if (0 != ch_checkrange(ch, csv.csv_type, csv.csv_unit)) { 850 if (0 != ch_checkrange(ch, csv.csv_type, csv.csv_unit)) {
@@ -861,7 +862,7 @@ static int ch_ioctl(struct inode * inode, struct file * file,
861 } 862 }
862 863
863 default: 864 default:
864 return scsi_ioctl(ch->device, cmd, (void*)arg); 865 return scsi_ioctl(ch->device, cmd, argp);
865 866
866 } 867 }
867} 868}
@@ -894,9 +895,9 @@ static long ch_ioctl_compat(struct file * file,
894 case CHIOGSTATUS32: 895 case CHIOGSTATUS32:
895 { 896 {
896 struct changer_element_status32 ces32; 897 struct changer_element_status32 ces32;
897 unsigned char *data; 898 unsigned char __user *data;
898 899
899 if (copy_from_user(&ces32, (void*)arg, sizeof (ces32))) 900 if (copy_from_user(&ces32, (void __user *)arg, sizeof (ces32)))
900 return -EFAULT; 901 return -EFAULT;
901 if (ces32.ces_type < 0 || ces32.ces_type >= CH_TYPES) 902 if (ces32.ces_type < 0 || ces32.ces_type >= CH_TYPES)
902 return -EINVAL; 903 return -EINVAL;
diff --git a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c
index d72be0ce89c8..3fda8d455c5b 100644
--- a/drivers/scsi/cpqfcTSinit.c
+++ b/drivers/scsi/cpqfcTSinit.c
@@ -691,8 +691,7 @@ int cpqfcTS_ioctl( struct scsi_device *ScsiDev, int Cmnd, void *arg)
691 if( copy_to_user( vendor_cmd->bufp, buf, vendor_cmd->len)) 691 if( copy_to_user( vendor_cmd->bufp, buf, vendor_cmd->len))
692 result = -EFAULT; 692 result = -EFAULT;
693 693
694 if( buf) 694 kfree(buf);
695 kfree( buf);
696 695
697 return result; 696 return result;
698 } 697 }
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index b5dc35355570..6e54c7d9b33c 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -36,7 +36,6 @@
36#include <linux/proc_fs.h> 36#include <linux/proc_fs.h>
37#include <linux/stat.h> 37#include <linux/stat.h>
38#include <linux/mca.h> 38#include <linux/mca.h>
39#include <linux/string.h>
40#include <linux/spinlock.h> 39#include <linux/spinlock.h>
41#include <linux/init.h> 40#include <linux/init.h>
42#include <linux/mca-legacy.h> 41#include <linux/mca-legacy.h>
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 89a4a0615c22..3f2f2464fa63 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -1377,7 +1377,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct scsi
1377 1377
1378 if ((STp->buffer)->syscall_result || !SRpnt) { 1378 if ((STp->buffer)->syscall_result || !SRpnt) {
1379 printk(KERN_ERR "%s:E: Failed to read frame back from OnStream buffer\n", name); 1379 printk(KERN_ERR "%s:E: Failed to read frame back from OnStream buffer\n", name);
1380 vfree((void *)buffer); 1380 vfree(buffer);
1381 *aSRpnt = SRpnt; 1381 *aSRpnt = SRpnt;
1382 return (-EIO); 1382 return (-EIO);
1383 } 1383 }
@@ -1419,7 +1419,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct scsi
1419 1419
1420 if (new_frame > frame + 1000) { 1420 if (new_frame > frame + 1000) {
1421 printk(KERN_ERR "%s:E: Failed to find writable tape media\n", name); 1421 printk(KERN_ERR "%s:E: Failed to find writable tape media\n", name);
1422 vfree((void *)buffer); 1422 vfree(buffer);
1423 return (-EIO); 1423 return (-EIO);
1424 } 1424 }
1425 if ( i >= nframes + pending ) break; 1425 if ( i >= nframes + pending ) break;
@@ -1500,7 +1500,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct scsi
1500 SRpnt->sr_sense_buffer[12] == 0 && 1500 SRpnt->sr_sense_buffer[12] == 0 &&
1501 SRpnt->sr_sense_buffer[13] == 2) { 1501 SRpnt->sr_sense_buffer[13] == 2) {
1502 printk(KERN_ERR "%s:E: Volume overflow in write error recovery\n", name); 1502 printk(KERN_ERR "%s:E: Volume overflow in write error recovery\n", name);
1503 vfree((void *)buffer); 1503 vfree(buffer);
1504 return (-EIO); /* hit end of tape = fail */ 1504 return (-EIO); /* hit end of tape = fail */
1505 } 1505 }
1506 i = ((SRpnt->sr_sense_buffer[3] << 24) | 1506 i = ((SRpnt->sr_sense_buffer[3] << 24) |
@@ -1525,7 +1525,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct scsi
1525 } 1525 }
1526 if (!pending) 1526 if (!pending)
1527 osst_copy_to_buffer(STp->buffer, p); /* so buffer content == at entry in all cases */ 1527 osst_copy_to_buffer(STp->buffer, p); /* so buffer content == at entry in all cases */
1528 vfree((void *)buffer); 1528 vfree(buffer);
1529 return 0; 1529 return 0;
1530} 1530}
1531 1531
@@ -5852,7 +5852,7 @@ static int osst_remove(struct device *dev)
5852 os_scsi_tapes[i] = NULL; 5852 os_scsi_tapes[i] = NULL;
5853 osst_nr_dev--; 5853 osst_nr_dev--;
5854 write_unlock(&os_scsi_tapes_lock); 5854 write_unlock(&os_scsi_tapes_lock);
5855 if (tpnt->header_cache != NULL) vfree(tpnt->header_cache); 5855 vfree(tpnt->header_cache);
5856 if (tpnt->buffer) { 5856 if (tpnt->buffer) {
5857 normalize_buffer(tpnt->buffer); 5857 normalize_buffer(tpnt->buffer);
5858 kfree(tpnt->buffer); 5858 kfree(tpnt->buffer);
@@ -5896,8 +5896,7 @@ static void __exit exit_osst (void)
5896 for (i=0; i < osst_max_dev; ++i) { 5896 for (i=0; i < osst_max_dev; ++i) {
5897 if (!(STp = os_scsi_tapes[i])) continue; 5897 if (!(STp = os_scsi_tapes[i])) continue;
5898 /* This is defensive, supposed to happen during detach */ 5898 /* This is defensive, supposed to happen during detach */
5899 if (STp->header_cache) 5899 vfree(STp->header_cache);
5900 vfree(STp->header_cache);
5901 if (STp->buffer) { 5900 if (STp->buffer) {
5902 normalize_buffer(STp->buffer); 5901 normalize_buffer(STp->buffer);
5903 kfree(STp->buffer); 5902 kfree(STp->buffer);
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index 623082d3a83f..c89da7d5b6df 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -95,8 +95,7 @@ int __init pluto_detect(Scsi_Host_Template *tpnt)
95 int i, retry, nplutos; 95 int i, retry, nplutos;
96 fc_channel *fc; 96 fc_channel *fc;
97 Scsi_Device dev; 97 Scsi_Device dev;
98 struct timer_list fc_timer = 98 DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0);
99 TIMER_INITIALIZER(pluto_detect_timeout, 0, 0);
100 99
101 tpnt->proc_name = "pluto"; 100 tpnt->proc_name = "pluto";
102 fcscount = 0; 101 fcscount = 0;
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 72bbaa91dc77..9791496fa788 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -1334,7 +1334,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1334 1334
1335 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1335 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);
1336 WRT_REG_DWORD(dmp_reg, 0xB0200000); 1336 WRT_REG_DWORD(dmp_reg, 0xB0200000);
1337 dmp_reg = (uint32_t *)((uint8_t *)reg + 0xFC); 1337 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xFC);
1338 fw->shadow_reg[2] = RD_REG_DWORD(dmp_reg); 1338 fw->shadow_reg[2] = RD_REG_DWORD(dmp_reg);
1339 1339
1340 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0); 1340 dmp_reg = (uint32_t __iomem *)((uint8_t __iomem *)reg + 0xF0);