From patchwork Mon Jun 1 12:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 11585169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C49D913 for ; Wed, 3 Jun 2020 07:04:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6558020674 for ; Wed, 3 Jun 2020 07:04:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6558020674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A122E6E4CF; Wed, 3 Jun 2020 07:04:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2B8F6E260 for ; Mon, 1 Jun 2020 12:32:29 +0000 (UTC) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id F07CE5836B1A6F7DA637; Mon, 1 Jun 2020 20:32:25 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Mon, 1 Jun 2020 20:32:19 +0800 From: yu kuai To: , , , Subject: [PATCH 1/2] drm/v3d: remove duplicated kfree in v3d_submit_cl_ioctl() Date: Mon, 1 Jun 2020 20:32:02 +0800 Message-ID: <20200601123202.3892415-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 03 Jun 2020 07:04:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yukuai3@huawei.com, dri-devel@lists.freedesktop.org, yi.zhang@huawei.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" kfree() is called twice for the same variable 'bin', the first is introduced in commit 0d352a3a8a1f ("drm/v3d: don't leak bin job if v3d_job_init fails."), while the second is introduced in commit 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl"). The latter one should fail since there is a conflict, however, it got merged somehow. Fix it by removing the function call which is introduced later. Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl") Signed-off-by: yu kuai --- drivers/gpu/drm/v3d/v3d_gem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 549dde83408b..271567600921 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -570,7 +570,6 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, if (ret) { kfree(bin); v3d_job_put(&render->base); - kfree(bin); return ret; }