[PATCH 2/2] qmi-firmware-update: fix CRC checking

Aleksander Morgado aleksander at aleksander.es
Tue Jan 17 09:15:13 UTC 2017


On Tue, Jan 17, 2017 at 9:17 AM, Christophe Ronco <c.ronco at kerlink.fr> wrote:
> CRC is not well checked if there is an escape char in input buffer.
> ---

Pushed to the branch, thanks.

>  src/qmi-firmware-update/qfu-qdl-device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/qmi-firmware-update/qfu-qdl-device.c b/src/qmi-firmware-update/qfu-qdl-device.c
> index d5252c1..ad94afc 100644
> --- a/src/qmi-firmware-update/qfu-qdl-device.c
> +++ b/src/qmi-firmware-update/qfu-qdl-device.c
> @@ -191,7 +191,7 @@ hdlc_unframe (const guint8 *in,
>      j -= 2; /* remove the crc */
>
>      /* verify the crc */
> -    crc = qfu_utils_crc16 (in, j);
> +    crc = qfu_utils_crc16 (out, j);
>      if (crc != (out[j] | out[j + 1] << 8)) {
>          g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
>                       "crc check failed: 0x%04x != 0x%04x\n", crc, out[j] | out[j + 1] << 8);
> --
> 2.11.0
>
> _______________________________________________
> libqmi-devel mailing list
> libqmi-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libqmi-devel



-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list