aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/amiflop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/amiflop.c')
-rw-r--r--drivers/block/amiflop.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 4c3b7df46f91..3e2530d61762 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1441,6 +1441,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1441{ 1441{
1442 int drive = iminor(inode) & 3; 1442 int drive = iminor(inode) & 3;
1443 static struct floppy_struct getprm; 1443 static struct floppy_struct getprm;
1444 void __user *argp = (void __user *)param;
1444 1445
1445 switch(cmd){ 1446 switch(cmd){
1446 case FDFMTBEG: 1447 case FDFMTBEG:
@@ -1486,9 +1487,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1486 getprm.head=unit[drive].type->heads; 1487 getprm.head=unit[drive].type->heads;
1487 getprm.sect=unit[drive].dtype->sects * unit[drive].type->sect_mult; 1488 getprm.sect=unit[drive].dtype->sects * unit[drive].type->sect_mult;
1488 getprm.size=unit[drive].blocks; 1489 getprm.size=unit[drive].blocks;
1489 if (copy_to_user((void *)param, 1490 if (copy_to_user(argp, &getprm, sizeof(struct floppy_struct)))
1490 (void *)&getprm,
1491 sizeof(struct floppy_struct)))
1492 return -EFAULT; 1491 return -EFAULT;
1493 break; 1492 break;
1494 case FDSETPRM: 1493 case FDSETPRM:
@@ -1500,8 +1499,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
1500 break; 1499 break;
1501#ifdef RAW_IOCTL 1500#ifdef RAW_IOCTL
1502 case IOCTL_RAW_TRACK: 1501 case IOCTL_RAW_TRACK:
1503 if (copy_to_user((void *)param, raw_buf, 1502 if (copy_to_user(argp, raw_buf, unit[drive].type->read_size))
1504 unit[drive].type->read_size))
1505 return -EFAULT; 1503 return -EFAULT;
1506 else 1504 else
1507 return unit[drive].type->read_size; 1505 return unit[drive].type->read_size;