diff options
| author | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2002-05-18 22:25:13 -0300 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-05-18 22:25:13 -0300 |
| commit | a465121e2b8a3e2cdb2aa39ab35d5a5131230265 (patch) | |
| tree | a5e81c2be8ad87d846abfb4a84369428e340d6a2 /drivers/usb/serial | |
| parent | 291884c98ae119a91d8afe0131019c66e3d6fbc7 (diff) | |
drivers/usr/*.c
- fix copy_{to,from}_user error handling (thanks to Rusty for pointing this out)
Diffstat (limited to 'drivers/usb/serial')
| -rw-r--r-- | drivers/usb/serial/ipaq.c | 3 | ||||
| -rw-r--r-- | drivers/usb/serial/safe_serial.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 80847784cbcd..734d7bca750f 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -353,7 +353,8 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un } if (from_user) { - copy_from_user(pkt->data, buf, count); + if (copy_from_user(pkt->data, buf, count)) + return -EFAULT; } else { memcpy(pkt->data, buf, count); } diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index ca80dc61e7d1..6e9acb5419c6 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c @@ -319,7 +319,8 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign memset (data, '0', packet_length); if (from_user) { - copy_from_user (data, buf, count); + if (copy_from_user (data, buf, count)) + return -EFAULT; } else { memcpy (data, buf, count); } |
