From: Javier Martinez Canillas Date: Tue, 25 Jan 2011 00:46:18 +0000 (+0100) Subject: Staging: bcm: Check correct user provided length and fix error code returned X-Git-Tag: v2.6.39-rc1~469^2~683 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00719fab9f6eb90b9e427d1096ad540d51878661;p=pandora-kernel.git Staging: bcm: Check correct user provided length and fix error code returned bcm driver copies a buffer length provided by userpace without checking it. RxCntrlMsgBitMask is of type unsigned long so only makes sense to copy sizeof(unsigned long) bytes. Also, copy_from_user() returns the number of bytes that could not be copied. The driver is returning that value as error code instead of -EFAULT. This patch solves both issues. Signed-off-by: Javier Martinez Canillas Cc: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed