Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18126
b: refs/heads/master
c: 2c7af51
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jan 12, 2006
1 parent 4546a03 commit 5168188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a423e542b4a9af45ac0106ab8275760af770793
refs/heads/master: 2c7af51129161a7a3dc4169c984964912f1f4822
9 changes: 5 additions & 4 deletions trunk/drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ static int floppy_revalidate(struct gendisk *disk)
formats, for 'permanent user-defined' parameter:
restore default_params[] here if flagged valid! */
if (default_params[drive].blocks == 0)
UDT = 0;
UDT = NULL;
else
UDT = &default_params[drive];
}
Expand Down Expand Up @@ -1495,6 +1495,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
struct floppy_struct getprm;
int settype;
struct floppy_struct setprm;
void __user *argp = (void __user *)param;

switch (cmd) {
case FDGETPRM:
Expand All @@ -1521,7 +1522,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
getprm.head = 2;
getprm.track = dtp->blocks/dtp->spt/2;
getprm.stretch = dtp->stretch;
if (copy_to_user((void *)param, &getprm, sizeof(getprm)))
if (copy_to_user(argp, &getprm, sizeof(getprm)))
return -EFAULT;
return 0;
}
Expand All @@ -1540,7 +1541,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
/* get the parameters from user space */
if (floppy->ref != 1 && floppy->ref != -1)
return -EBUSY;
if (copy_from_user(&setprm, (void *) param, sizeof(setprm)))
if (copy_from_user(&setprm, argp, sizeof(setprm)))
return -EFAULT;
/*
* first of all: check for floppy change and revalidate,
Expand Down Expand Up @@ -1647,7 +1648,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
case FDFMTTRK:
if (floppy->ref != 1 && floppy->ref != -1)
return -EBUSY;
if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc)))
if (copy_from_user(&fmt_desc, argp, sizeof(fmt_desc)))
return -EFAULT;
return do_format(drive, type, &fmt_desc);
case FDCLRPRM:
Expand Down

0 comments on commit 5168188

Please sign in to comment.