Return-Path: Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sdjhl3L0KzDsfj for ; Tue, 20 Sep 2016 23:07:19 +1000 (AEST) In-Reply-To: <5667FBD5.2050206@linux.vnet.ibm.com> To: xinhui , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org From: Michael Ellerman Cc: Andrzej Hajda , Christophe Jaillet , Nathan Fontenot , Hari Bathini , Paul Mackerras Subject: Re: powerpc/nvram: Fix a memory leak in err path Message-Id: <3sdjhl1yhFz9sQw@ozlabs.org> Date: Tue, 20 Sep 2016 23:07:19 +1000 (AEST) List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2015-09-12 at 10:00:53 UTC, xinhui wrote: > If kmemdup fails, We need kfree *buff* first then return -ENOMEM. > Otherwise there is a memory leak. > > Signed-off-by: Pan Xinhui > Reviewed-by: Nathan Fontenot Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0d0fecc5b5bfddb0e67bef985c cheers