Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3338623ybg; Fri, 25 Oct 2019 02:39:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxf0orFtKDShZ9XR4i+4ZpD6PPUFBSMk/sJeQ2XvCwd8MtWe4163BzSkd279B/IvprpWSYp X-Received: by 2002:aa7:df85:: with SMTP id b5mr2836201edy.298.1571996364029; Fri, 25 Oct 2019 02:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571996364; cv=none; d=google.com; s=arc-20160816; b=LL96lgvLe8EsSa61zNTlUPVWswbPHIDNAqLe9cXpP8+AN+aKXCNn+iy5AukzUkBMcD /qQtCtF7hCmtxhjEcqsAJS0X10OkYNY2GeAX4PXndzL7M04wOUHbW6U/bFWYv8ThxrYi nfuCdQ+i7hVzub8/sOsLeZzhMqPVS6HFwFDKMNzFas0nVfpXrmbOufdMtb6FuA1cRLcl bwGYtymJ9/Cun+z0WfGyZUtG2aCDf8FYIe4FQEP/7/M+e/0XGYMQrHNlSVw76l3uVit5 Dsito3enNNz1rYV7cwkBbghoeljc7NVOOy6AX2ARH+hWTlmJzDrxaixiHPDAg1skHDRZ rg/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HXx4+HrrigHqqSBEue3k+Qx+5itO927mYVbrMLk1NQk=; b=VEIKXYEmZmD8a6v/daEociryQEVbGmVG1ZSXvRj7XQwWpeL1+qr3IHnP8icnzlZHbi rQuRpFHivoCQFLj8c4y/pQJZzISsmQKxqkkA436G4zYStx+COr3dUFhGsksO8Qu8o5RF 0PvqdoyrrCJvD4dhbM5CZpqNDUQaHZbZ5HiP8V19ItlChIHpxR7t+h7v24QLgRkycMBL 9DcejGHWWz13UuZ4d4ff6/uG5ROaTrP2eNW5mKcKP6tXQdeuNd2nrt+pjZ9mpHO7wR+D v/ullPyn04Q5paQ1h2j8KxmhJGOEw9bgtZWXShjgy+CZ4CifDeUP1eRhJSIL2zWwzbeS SWog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c36si994380edf.165.2019.10.25.02.38.59; Fri, 25 Oct 2019 02:39:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393251AbfJXKsI (ORCPT + 99 others); Thu, 24 Oct 2019 06:48:08 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34820 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391340AbfJXKsI (ORCPT ); Thu, 24 Oct 2019 06:48:08 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iNaew-0008Dr-2f; Thu, 24 Oct 2019 10:48:02 +0000 From: Colin King To: Eric Anholt , David Airlie , Daniel Vetter , Navid Emamdoost , Iago Toral Quiroga , dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] drm/v3d: fix double free of bin Date: Thu, 24 Oct 2019 11:48:01 +0100 Message-Id: <20191024104801.3122-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Two different fixes have addressed the same memory leak of bin and this now causes a double free of bin. While the individual memory leak fixes are fine, both fixes together are problematic. Addresses-Coverity: ("Double free") Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl") Fixes: 0d352a3a8a1f (" rm/v3d: don't leak bin job if v3d_job_init fails.") Signed-off-by: Colin Ian King --- 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..37515e47b47e 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -568,7 +568,6 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, ret = v3d_job_init(v3d, file_priv, &bin->base, v3d_job_free, args->in_sync_bcl); if (ret) { - kfree(bin); v3d_job_put(&render->base); kfree(bin); return ret; -- 2.20.1