From patchwork Mon Sep 16 07:11:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iago Toral X-Patchwork-Id: 11146461 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 BF6C41747 for ; Mon, 16 Sep 2019 07:11:34 +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 BB7CB20890 for ; Mon, 16 Sep 2019 07:11:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB7CB20890 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=igalia.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 0E9136E114; Mon, 16 Sep 2019 07:11:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fanzine.igalia.com (fanzine.igalia.com [91.117.99.155]) by gabe.freedesktop.org (Postfix) with ESMTPS id C5D736E114 for ; Mon, 16 Sep 2019 07:11:31 +0000 (UTC) Received: from [192.168.12.205] (helo=localhost.localdomain) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim) id 1i9lAX-00040d-AX; Mon, 16 Sep 2019 09:11:29 +0200 From: Iago Toral Quiroga To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/v3d: don't leak bin job if v3d_job_init fails. Date: Mon, 16 Sep 2019 09:11:25 +0200 Message-Id: <20190916071125.5255-1-itoral@igalia.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:Cc:To:From; bh=+o3diaoC5+PdB44OtueaL8mTMKoNOeI3B686MinHTqA=; b=Qx0nLMxKwAq/GRFOi/uPCDbvilO7vGQn+ma3c+6HjeRrP+5MOsDvzBuI4RmI6K4YAxM1CqUdSJQDPlGzgZHgwrCJVepegOE+DzzctMkReHx+Zwb60nsfY2o1nmqIhiF97X1s5wA4UZpP+Eq242SnYEJ0KkmsaHaGLU8YJ7t4rZWgI0O5Wv0KGxEnChC5jipD71WTFsSBgUy7YR+7rmqqULkTAIvmo38aG1/udFvCW9qh2vFLDAXpw8vRuUZzBagxPML9NYSdlrmjIYuWZhaUH+DvQcS2i5SdKDhCa6/Dkx1tbdRgriqtG92QolYPTkYCwkldQVd+S1Vy6tzVIhj9Ag==; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Iago Toral Quiroga MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If the initialization of the job fails we need to kfree() it before returning. Signed-off-by: Iago Toral Quiroga --- drivers/gpu/drm/v3d/v3d_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index d46d91346d09..ed68731404a7 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -566,6 +566,7 @@ 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); return ret; }