diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/raw1394.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c index 89cac1f55807..b05235639918 100644 --- a/drivers/ieee1394/raw1394.c +++ b/drivers/ieee1394/raw1394.c | |||
@@ -2482,8 +2482,8 @@ static int raw1394_iso_recv_packets(struct file_info *fi, void __user * uaddr) | |||
2482 | 2482 | ||
2483 | /* ensure user-supplied buffer is accessible and big enough */ | 2483 | /* ensure user-supplied buffer is accessible and big enough */ |
2484 | if (!access_ok(VERIFY_WRITE, upackets.infos, | 2484 | if (!access_ok(VERIFY_WRITE, upackets.infos, |
2485 | upackets.n_packets * | 2485 | upackets.n_packets * |
2486 | sizeof(struct raw1394_iso_packet_info))) | 2486 | sizeof(struct raw1394_iso_packet_info))) |
2487 | return -EFAULT; | 2487 | return -EFAULT; |
2488 | 2488 | ||
2489 | /* copy the packet_infos out */ | 2489 | /* copy the packet_infos out */ |
@@ -2516,8 +2516,8 @@ static int raw1394_iso_send_packets(struct file_info *fi, void __user * uaddr) | |||
2516 | 2516 | ||
2517 | /* ensure user-supplied buffer is accessible and big enough */ | 2517 | /* ensure user-supplied buffer is accessible and big enough */ |
2518 | if (!access_ok(VERIFY_READ, upackets.infos, | 2518 | if (!access_ok(VERIFY_READ, upackets.infos, |
2519 | upackets.n_packets * | 2519 | upackets.n_packets * |
2520 | sizeof(struct raw1394_iso_packet_info))) | 2520 | sizeof(struct raw1394_iso_packet_info))) |
2521 | return -EFAULT; | 2521 | return -EFAULT; |
2522 | 2522 | ||
2523 | /* copy the infos structs in and queue the packets */ | 2523 | /* copy the infos structs in and queue the packets */ |
@@ -2741,8 +2741,7 @@ static int raw1394_release(struct inode *inode, struct file *file) | |||
2741 | list) { | 2741 | list) { |
2742 | entry = fi_hlp->addr_list.next; | 2742 | entry = fi_hlp->addr_list.next; |
2743 | while (entry != &(fi_hlp->addr_list)) { | 2743 | while (entry != &(fi_hlp->addr_list)) { |
2744 | arm_addr = list_entry(entry, | 2744 | arm_addr = list_entry(entry, struct |
2745 | struct | ||
2746 | arm_addr, | 2745 | arm_addr, |
2747 | addr_list); | 2746 | addr_list); |
2748 | if (arm_addr->start == | 2747 | if (arm_addr->start == |
@@ -2905,16 +2904,17 @@ static int __init init_raw1394(void) | |||
2905 | 2904 | ||
2906 | hpsb_register_highlevel(&raw1394_highlevel); | 2905 | hpsb_register_highlevel(&raw1394_highlevel); |
2907 | 2906 | ||
2908 | if (IS_ERR(class_device_create(hpsb_protocol_class, NULL, MKDEV( | 2907 | if (IS_ERR |
2909 | IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), | 2908 | (class_device_create |
2910 | NULL, RAW1394_DEVICE_NAME))) { | 2909 | (hpsb_protocol_class, NULL, |
2910 | MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), NULL, | ||
2911 | RAW1394_DEVICE_NAME))) { | ||
2911 | ret = -EFAULT; | 2912 | ret = -EFAULT; |
2912 | goto out_unreg; | 2913 | goto out_unreg; |
2913 | } | 2914 | } |
2914 | 2915 | ||
2915 | devfs_mk_cdev(MKDEV( | 2916 | devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), |
2916 | IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), | 2917 | S_IFCHR | S_IRUSR | S_IWUSR, RAW1394_DEVICE_NAME); |
2917 | S_IFCHR | S_IRUSR | S_IWUSR, RAW1394_DEVICE_NAME); | ||
2918 | 2918 | ||
2919 | cdev_init(&raw1394_cdev, &raw1394_fops); | 2919 | cdev_init(&raw1394_cdev, &raw1394_fops); |
2920 | raw1394_cdev.owner = THIS_MODULE; | 2920 | raw1394_cdev.owner = THIS_MODULE; |
@@ -2936,20 +2936,22 @@ static int __init init_raw1394(void) | |||
2936 | 2936 | ||
2937 | goto out; | 2937 | goto out; |
2938 | 2938 | ||
2939 | out_dev: | 2939 | out_dev: |
2940 | devfs_remove(RAW1394_DEVICE_NAME); | 2940 | devfs_remove(RAW1394_DEVICE_NAME); |
2941 | class_device_destroy(hpsb_protocol_class, | 2941 | class_device_destroy(hpsb_protocol_class, |
2942 | MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)); | 2942 | MKDEV(IEEE1394_MAJOR, |
2943 | out_unreg: | 2943 | IEEE1394_MINOR_BLOCK_RAW1394 * 16)); |
2944 | out_unreg: | ||
2944 | hpsb_unregister_highlevel(&raw1394_highlevel); | 2945 | hpsb_unregister_highlevel(&raw1394_highlevel); |
2945 | out: | 2946 | out: |
2946 | return ret; | 2947 | return ret; |
2947 | } | 2948 | } |
2948 | 2949 | ||
2949 | static void __exit cleanup_raw1394(void) | 2950 | static void __exit cleanup_raw1394(void) |
2950 | { | 2951 | { |
2951 | class_device_destroy(hpsb_protocol_class, | 2952 | class_device_destroy(hpsb_protocol_class, |
2952 | MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)); | 2953 | MKDEV(IEEE1394_MAJOR, |
2954 | IEEE1394_MINOR_BLOCK_RAW1394 * 16)); | ||
2953 | cdev_del(&raw1394_cdev); | 2955 | cdev_del(&raw1394_cdev); |
2954 | devfs_remove(RAW1394_DEVICE_NAME); | 2956 | devfs_remove(RAW1394_DEVICE_NAME); |
2955 | hpsb_unregister_highlevel(&raw1394_highlevel); | 2957 | hpsb_unregister_highlevel(&raw1394_highlevel); |