From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756857Ab3KHJ1U (ORCPT ); Fri, 8 Nov 2013 04:27:20 -0500 Received: from nat28.tlf.novell.com ([130.57.49.28]:50677 "EHLO nat28.tlf.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756665Ab3KHJ1O convert rfc822-to-8bit (ORCPT ); Fri, 8 Nov 2013 04:27:14 -0500 Message-Id: <527CBC7D020000780010117C@nat28.tlf.novell.com> X-Mailer: Novell GroupWise Internet Agent 12.0.2 Date: Fri, 08 Nov 2013 09:27:09 +0000 From: "Jan Beulich" To: Cc: "Matthew Daley" , , Subject: [PATCH] unlz4: always set an error return code on failures Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "ret", being set to -1 early on, gets cleared by the first invocation of lz4_decompress()/lz4_decompress_unknownoutputsize(), and hence subsequent failures wouldn't be noticed by the caller without setting it back to -1 right after those calls. Reported-by: Matthew Daley Signed-off-by: Jan Beulich Cc: Kyungsik Lee Cc: Andrew Morton --- a/lib/decompress_unlz4.c +++ b/lib/decompress_unlz4.c @@ -141,6 +141,7 @@ STATIC inline int INIT unlz4(u8 *input, goto exit_2; } + ret = -1; if (flush && flush(outp, dest_len) != dest_len) goto exit_2; if (output)