ssb: Fix range check in sprom write
commitd66f16e8a63d1f2198bc2cd8e6bd91b5378fca20
authorMichael Buesch <mb@bu3sch.de>
Mon, 23 Nov 2009 19:58:06 +0000 (23 20:58 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:30:47 +0000 (18 13:30 -0800)
tree91171ba97bfe5722d76da0c2d52284ee421590e9
parent4a4e3688bd53ac0bb5d40d33a666e9e343da562b
ssb: Fix range check in sprom write

commit e33761e6f23881de9f3ee77cc2204ab2e26f3d9a upstream.

The range check in the sprom image parser hex2sprom() is broken.
One sprom word is 4 hex characters.
This fixes the check and also adds much better sanity checks to the code.
We better make sure the image is OK by doing some sanity checks to avoid
bricking the device by accident.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ssb/sprom.c