提交 c6236c0c 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: drivers: fix return value of comedi_load_firmware()

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: NBernd Porr <mail@berndporr.me.uk>
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: NIan Abbott <abbotti@mev.co.uk>
Acked-by: NDan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0283f7a1
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册