Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39813
b: refs/heads/master
c: 96a5189
h: refs/heads/master
i:
  39811: bf14de0
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 17, 2006
1 parent cb5daac commit 34e29c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 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: 516077c1ee8a4a47cc41634a29954b636f3975ea
refs/heads/master: 96a518928e1fd00a6d0eb344f420ea82aeec8ab9
34 changes: 11 additions & 23 deletions trunk/drivers/usb/misc/ftdi-elan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,11 +1186,8 @@ static ssize_t ftdi_elan_write(struct file *file,
int retval = 0;
struct urb *urb;
char *buf;
char data[30 *3 + 4];
char *d = data;
const char __user *s = user_buffer;
int m = (sizeof(data) - 1) / 3;
struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data;
struct usb_ftdi *ftdi = file->private_data;

if (ftdi->disconnected > 0) {
return -ENODEV;
}
Expand Down Expand Up @@ -1220,27 +1217,18 @@ static ssize_t ftdi_elan_write(struct file *file,
if (retval) {
dev_err(&ftdi->udev->dev, "failed submitting write urb, error %"
"d\n", retval);
goto error_4;
goto error_3;
}
usb_free_urb(urb);
exit:;
if (count > m) {
int I = m - 1;
while (I-- > 0) {
d += sprintf(d, " %02X", 0x000000FF & *s++);
}
d += sprintf(d, " ..");
} else {
int I = count;
while (I-- > 0) {
d += sprintf(d, " %02X", 0x000000FF & *s++);
}
}

exit:
return count;
error_4: error_3:usb_buffer_free(ftdi->udev, count, buf,
urb->transfer_dma);
error_2:usb_free_urb(urb);
error_1:return retval;
error_3:
usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
error_2:
usb_free_urb(urb);
error_1:
return retval;
}

static struct file_operations ftdi_elan_fops = {
Expand Down

0 comments on commit 34e29c8

Please sign in to comment.