From: Greg Kroah-Hartman Date: Tue, 17 Aug 2010 22:15:37 +0000 (-0700) Subject: USB: io_ti: check firmware version before updating X-Git-Tag: v2.6.35.4~6 X-Git-Url: https://git.kernelconcepts.de/?a=commitdiff_plain;h=e5af095003749e3f9bc1ff3db77ef7c91dc79459;p=karo-tx-linux.git USB: io_ti: check firmware version before updating 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 Tested-by: Chris Beauchamp Cc: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 0fca2659206f..99910632c6c3 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -1151,7 +1151,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,