From: Simon Glass Date: Tue, 2 Dec 2014 20:17:40 +0000 (-0700) Subject: lzo: Update dst_len even on error X-Git-Tag: v2015.04-rc1~96 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=670c0179ec1f48e0113ec082143a9acdd2f7d6aa;p=u-boot lzo: Update dst_len even on error This allows the caller to easily detect how much of the destination buffer has been used. Signed-off-by: Simon Glass --- diff --git a/lib/lzo/lzo1x_decompress.c b/lib/lzo/lzo1x_decompress.c index 35f3793f31..ebdf10b988 100644 --- a/lib/lzo/lzo1x_decompress.c +++ b/lib/lzo/lzo1x_decompress.c @@ -102,8 +102,10 @@ int lzop_decompress(const unsigned char *src, size_t src_len, tmp = dlen; r = lzo1x_decompress_safe((u8 *) src, slen, dst, &tmp); - if (r != LZO_E_OK) + if (r != LZO_E_OK) { + *dst_len = dst - start; return r; + } if (dlen != tmp) return LZO_E_ERROR;