Commit bc32f3fb authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] USB: missed one usblp status buffer change

My previous patch (several months ago) missed one instance of
changing usblp status data from local stack to alloc-ed memory.
parent 00b8924f
...@@ -426,7 +426,7 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -426,7 +426,7 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
{ {
struct usblp *usblp = file->private_data; struct usblp *usblp = file->private_data;
int length, err, i; int length, err, i;
unsigned char lpstatus, newChannel; unsigned char newChannel;
int status; int status;
int twoints[2]; int twoints[2];
int retval = 0; int retval = 0;
...@@ -578,12 +578,12 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -578,12 +578,12 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
switch (cmd) { switch (cmd) {
case LPGETSTATUS: case LPGETSTATUS:
if (usblp_read_status(usblp, &lpstatus)) { if (usblp_read_status(usblp, usblp->statusbuf)) {
err("usblp%d: failed reading printer status", usblp->minor); err("usblp%d: failed reading printer status", usblp->minor);
retval = -EIO; retval = -EIO;
goto done; goto done;
} }
status = lpstatus; status = *usblp->statusbuf;
if (copy_to_user ((int *)arg, &status, sizeof(int))) if (copy_to_user ((int *)arg, &status, sizeof(int)))
retval = -EFAULT; retval = -EFAULT;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment