Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0827a9ff authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

USB: io_ti: check firmware version before updating



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: default avatarChris Beauchamp <chris@chillibean.tv>
Tested-by: default avatarChris Beauchamp <chris@chillibean.tv>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d1ab903d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1151,7 +1151,7 @@ static int download_fw(struct edgeport_serial *serial)


			/* Check if we have an old version in the I2C and
			/* Check if we have an old version in the I2C and
			   update if necessary */
			   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",
				dbg("%s - Update I2C dld from %d.%d to %d.%d",
				    __func__,
				    __func__,
				    firmware_version->Ver_Major,
				    firmware_version->Ver_Major,