patch-2.4.22 linux-2.4.22/drivers/ieee1394/amdtp.c
Next file: linux-2.4.22/drivers/ieee1394/cmp.c
Previous file: linux-2.4.22/drivers/ieee1394/Makefile
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
2003-08-25 04:44:41.000000000 -0700
- Orig file:
linux-2.4.21/drivers/ieee1394/amdtp.c
- Orig date:
2003-06-13 07:51:34.000000000 -0700
diff -urN linux-2.4.21/drivers/ieee1394/amdtp.c linux-2.4.22/drivers/ieee1394/amdtp.c
@@ -62,6 +62,12 @@
* - Maybe make an ALSA interface, that is, create a file_ops
* implementation that recognizes ALSA ioctls and uses defaults for
* things that can't be controlled through ALSA (iso channel).
+ *
+ * Changes:
+ *
+ * - Audit copy_from_user in amdtp_write.
+ * Daniele Bellucci <bellucda@tiscali.it>
+ *
*/
#include <linux/module.h>
@@ -732,7 +738,7 @@
/* Fill IEEE1394 headers */
packet->db->header_desc.header[0] =
- (SPEED_100 << 16) | (0x01 << 14) |
+ (IEEE1394_SPEED_100 << 16) | (0x01 << 14) |
(s->iso_channel << 8) | (TCODE_ISO_DATA << 4);
packet->db->header_desc.header[1] = size << 16;
@@ -1112,7 +1118,8 @@
for (i = 0; i < count; i += length) {
p = buffer_put_bytes(s->input, count - i, &length);
- copy_from_user(p, buffer + i, length);
+ if (copy_from_user(p, buffer + i, length))
+ return -EFAULT;
if (s->input->length < s->input->size)
continue;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)