Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3211666pxb; Mon, 9 Nov 2020 05:42:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfn3VLprm4/lZlVa/Ip1RcUFSEY4ybtvPpk0JBB4nj7n+EWl9t4Syn3F79CD2YMlttoOka X-Received: by 2002:a50:ee97:: with SMTP id f23mr15810802edr.333.1604929377511; Mon, 09 Nov 2020 05:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929377; cv=none; d=google.com; s=arc-20160816; b=J0W3zREMLXx9q8xCn6ndl0OLXrkDejhNTvMu6wWFqrDP7o6lNh//NGYGhNnAcDGXs6 JczGbZZ1n4jMOiXjK2gaKJJ2ksgVj8Qz+Po6XycdJmPNsTV9uPdiawzpxCaTfBgylqsP qWDpz6zD4wUYb1fmBzY4akkm46tdZ74WJbdSXxy50QdsNwD6+hcntthcvvAj1MrYwzh3 UWDmRJEUXHzi7C62ya/2XzdOzv1bpk4mx2rdR4EzyIyeThGrSiXs8uVDHNr1xhffJAjQ Zht0T7DZLWwQ01SK5c+0ewA0WOdx3337ccAM2FbZUPz6H4gNSMQm4qvkQgdXkF8Tw6HL KrgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YJY6LbPpEHfKjUK0S1zUZm3FnWS21gMm7VBFJq/QiHc=; b=KxXBm0m/VUOmq4vgQxRQmG/rSQEb5npuosoFIsFbIWqRkcuXmwySlr52hNIMzKaIOI urrBe8wyusxtQVk4UD4m5sZj9GWJu1lXTTGRntxmk+0KsfMG7bSdsyf1O04rYP4nGgaN j54plbzdkN4kzhd74no7fvl3lPgjfk+u6fATaPBHf+uUo2NW2SjFdXqMnxYOgxD0ywmc eKek2by4LR+GzpirCdwtRB9oWVGJ/AUOtSMjlszQwD8BGVdDA8aNAFvS21wuTKhwmmeG ZhIrmbfSFf5DdCN+J/5vtteumbLvZ+4iUjgaOln+Ms5KgpdPiYBjoWHLEcHopa9RdoTQ BbFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V3SVTrQa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 92si7382373edg.183.2020.11.09.05.42.33; Mon, 09 Nov 2020 05:42:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V3SVTrQa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730607AbgKINjI (ORCPT + 99 others); Mon, 9 Nov 2020 08:39:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:56144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730662AbgKINDk (ORCPT ); Mon, 9 Nov 2020 08:03:40 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 293C922210; Mon, 9 Nov 2020 13:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926985; bh=eSPdUNSrzMNvWnZGQeWWlmUQk5bq+1LKzjc1HE76wjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3SVTrQatFU/Y1ox7G9gTv16p8Pz0S03a9UE0FmlLxb4SqJa0YZVAhZBUL8/OlB5j +btv4YxrsyyTXcTnJ1FP3qnJ1Zd+QmGofhckuYvO1m49qv02awfu3S716yB7G6Fspi LrWz0nITyMfbLbfGKh/QnDdCwC0tAjwEAEYqc90U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhihao Cheng , Richard Weinberger Subject: [PATCH 4.9 071/117] ubifs: dent: Fix some potential memory leaks while iterating entries Date: Mon, 9 Nov 2020 13:54:57 +0100 Message-Id: <20201109125029.052423941@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhihao Cheng commit 58f6e78a65f1fcbf732f60a7478ccc99873ff3ba upstream. Fix some potential memory leaks in error handling branches while iterating dent entries. For example, function dbg_check_dir() forgets to free pdent if it exists. Signed-off-by: Zhihao Cheng Cc: Fixes: 1e51764a3c2ac05a2 ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/ubifs/debug.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -1125,6 +1125,7 @@ int dbg_check_dir(struct ubifs_info *c, err = PTR_ERR(dent); if (err == -ENOENT) break; + kfree(pdent); return err; }