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,
{
struct usblp *usblp = file->private_data;
int length, err, i;
unsigned char lpstatus, newChannel;
unsigned char newChannel;
int status;
int twoints[2];
int retval = 0;
......@@ -578,12 +578,12 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
switch (cmd) {
case LPGETSTATUS:
if (usblp_read_status(usblp, &lpstatus)) {
if (usblp_read_status(usblp, usblp->statusbuf)) {
err("usblp%d: failed reading printer status", usblp->minor);
retval = -EIO;
goto done;
}
status = lpstatus;
status = *usblp->statusbuf;
if (copy_to_user ((int *)arg, &status, sizeof(int)))
retval = -EFAULT;
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