isight_firmware: Avoid crash on loading invalid firmware
authorMatthew Garrett <mjg59@srcf.ucam.org>
Fri, 6 Jun 2008 19:35:15 +0000 (12:35 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jun 2008 00:06:33 +0000 (17:06 -0700)
commit62b5884875fcd4babf6c0c377046f226abbfe491
treee0aa7d2f40ef390403bfc7258199fe7b7cca399b
parent6460a261b5893e769a314c246faec31bbc4aad9c
isight_firmware: Avoid crash on loading invalid firmware

Different tools generate slightly different formats of the isight
firmware. Ensure that the firmware buffer is not overrun, while still
ensuring that the correct amount of data is written if trailing data is
present.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Report-by: Justin Mattock <justinmattock@gmail.com>
Tested-by: Justin Mattock <justinmattock@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/isight_firmware.c