On Tue, Jan 14, K. Y. Srinivasan wrote:

This function should return valid numbers:

> +static ssize_t fcopy_write(struct file *file, const char __user *buf,
> +                     size_t count, loff_t *ppos)
> +{
> +     int error = 0;
> +
> +     if (count != sizeof(int))
> +             return 0;

Should be an error.

> +
> +     if (copy_from_user(&error, buf, sizeof(int)))
> +             return -EFAULT;
> +
> +     if (in_hand_shake) {
> +             fcopy_handle_handshake();
> +             return 0;

Should be sizeof(int).

> +     }
> +
> +     /*
> +      * Complete the transaction by forwarding the result
> +      * to the host. But first, cancel the timeout.
> +      */
> +     if (cancel_delayed_work_sync(&fcopy_work))
> +             fcopy_respond_to_host(error);
> +
> +     return sizeof(int);
> +}

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to