Re: Reading the frame number field

Pete Zaitcev <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat, Inc.
Message-ID <[email protected]>
On Sat, 14 Apr 2007 12:55:43 -0400 (EDT), Alan Stern <[email protected]> wrote:
> +	frame_number = usb_get_current_frame_number(ps->dev);
> +	if (put_user(frame_number, (int __user *)arg))
> +		return -EFAULT;
> +	return 0;

I think it would be safer to test frame_number for being negative and
return the error in errno rather than the frame number.

-- Pete

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.