staging: comedi: drivers: fix return value of comedi_load_firmware()
authorH Hartley Sweeten <[email protected]>
Tue, 10 Dec 2013 23:31:25 +0000 (16:31 -0700)
committerGreg Kroah-Hartman <[email protected]>
Tue, 17 Dec 2013 21:05:53 +0000 (13:05 -0800)
Some of the callback functions that upload the firmware in the comedi
drivers return a positive value indicating the number of bytes sent
to the device. Detect this condition and just return '0' to indicate
a successful upload.

Reported-by: Bernd Porr <[email protected]>
Signed-off-by: H Hartley Sweeten <[email protected]>
Acked-by: Ian Abbott <[email protected]>
Acked-by: Dan Carpenter <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/comedi/drivers.c

index 8f02bf66e20b2002b3b52655919a89f95c0fcad9..4964d2a2fc7d54ba099541b3f9c2c61be4799936 100644 (file)
@@ -446,7 +446,7 @@ int comedi_load_firmware(struct comedi_device *dev,
                release_firmware(fw);
        }
 
-       return ret;
+       return ret < 0 ? ret : 0;
 }
 EXPORT_SYMBOL_GPL(comedi_load_firmware);