Staging: bcm: potential forever loop verifying firmware
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Mar 2013 20:28:06 +0000 (23:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Mar 2013 16:15:32 +0000 (09:15 -0700)
commit2c5270ac807e46889fb08c3cf3c65902d0c35bb2
tree8cc87bce0080428f181873900fcfc26ed4eac16a
parent075dd9b83da5bc54b53b23f6e315c19b54f2d800
Staging: bcm: potential forever loop verifying firmware

There is an ioctl() to write data to the firmware.  After the data
is written, it reads the databack from the firmware and compares
against what the user wanted to write and prints an error message
if it doesn't match.

The problem is that verify process has a forever loop if the
firmware size is not a multiple of 4.  I've fixed it by replacing
the bcm compare function with memcmp().

I have chopped out some debugging code in the process.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/InterfaceDld.c