aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/ataflop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/ataflop.c')
-rw-r--r--drivers/block/ataflop.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 3aa68a5447d6..69c58ee7b2b6 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1361,7 +1361,7 @@ static int floppy_revalidate(struct gendisk *disk)
1361 formats, for 'permanent user-defined' parameter: 1361 formats, for 'permanent user-defined' parameter:
1362 restore default_params[] here if flagged valid! */ 1362 restore default_params[] here if flagged valid! */
1363 if (default_params[drive].blocks == 0) 1363 if (default_params[drive].blocks == 0)
1364 UDT = 0; 1364 UDT = NULL;
1365 else 1365 else
1366 UDT = &default_params[drive]; 1366 UDT = &default_params[drive];
1367 } 1367 }
@@ -1495,6 +1495,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1495 struct floppy_struct getprm; 1495 struct floppy_struct getprm;
1496 int settype; 1496 int settype;
1497 struct floppy_struct setprm; 1497 struct floppy_struct setprm;
1498 void __user *argp = (void __user *)param;
1498 1499
1499 switch (cmd) { 1500 switch (cmd) {
1500 case FDGETPRM: 1501 case FDGETPRM:
@@ -1521,7 +1522,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1521 getprm.head = 2; 1522 getprm.head = 2;
1522 getprm.track = dtp->blocks/dtp->spt/2; 1523 getprm.track = dtp->blocks/dtp->spt/2;
1523 getprm.stretch = dtp->stretch; 1524 getprm.stretch = dtp->stretch;
1524 if (copy_to_user((void *)param, &getprm, sizeof(getprm))) 1525 if (copy_to_user(argp, &getprm, sizeof(getprm)))
1525 return -EFAULT; 1526 return -EFAULT;
1526 return 0; 1527 return 0;
1527 } 1528 }
@@ -1540,7 +1541,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1540 /* get the parameters from user space */ 1541 /* get the parameters from user space */
1541 if (floppy->ref != 1 && floppy->ref != -1) 1542 if (floppy->ref != 1 && floppy->ref != -1)
1542 return -EBUSY; 1543 return -EBUSY;
1543 if (copy_from_user(&setprm, (void *) param, sizeof(setprm))) 1544 if (copy_from_user(&setprm, argp, sizeof(setprm)))
1544 return -EFAULT; 1545 return -EFAULT;
1545 /* 1546 /*
1546 * first of all: check for floppy change and revalidate, 1547 * first of all: check for floppy change and revalidate,
@@ -1647,7 +1648,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1647 case FDFMTTRK: 1648 case FDFMTTRK:
1648 if (floppy->ref != 1 && floppy->ref != -1) 1649 if (floppy->ref != 1 && floppy->ref != -1)
1649 return -EBUSY; 1650 return -EBUSY;
1650 if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc))) 1651 if (copy_from_user(&fmt_desc, argp, sizeof(fmt_desc)))
1651 return -EFAULT; 1652 return -EFAULT;
1652 return do_format(drive, type, &fmt_desc); 1653 return do_format(drive, type, &fmt_desc);
1653 case FDCLRPRM: 1654 case FDCLRPRM: