]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: io_ti: check firmware version before updating
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Aug 2010 22:15:37 +0000 (15:15 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:44:08 +0000 (16:44 -0700)
commit 0827a9ff2bbcbb03c33f1a6eb283fe051059482c upstream.

If we can't read the firmware for a device from the disk, and yet the
device already has a valid firmware image in it, we don't want to
replace the firmware with something invalid.  So check the version
number to be less than the current one to verify this is the correct
thing to do.

Reported-by: Chris Beauchamp <chris@chillibean.tv>
Tested-by: Chris Beauchamp <chris@chillibean.tv>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/io_ti.c

index aa876f71f228e4f8bf053e66fc331aca593f7b54..b6e8908b5080cbd64feb578254237fd7987e95b7 100644 (file)
@@ -1174,7 +1174,7 @@ static int download_fw(struct edgeport_serial *serial)
 
                        /* Check if we have an old version in the I2C and
                           update if necessary */
-                       if (download_cur_ver != download_new_ver) {
+                       if (download_cur_ver < download_new_ver) {
                                dbg("%s - Update I2C dld from %d.%d to %d.%d",
                                    __func__,
                                    firmware_version->Ver_Major,