Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp850792pxk; Thu, 17 Sep 2020 19:02:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfrtaORpG9MdcCn7W0Clif1Wq4UY5L1A0b5gXD9fTGGqSZOrJ1L181nCNjoM4P9BvH40Yk X-Received: by 2002:a17:906:7143:: with SMTP id z3mr32627472ejj.361.1600394555969; Thu, 17 Sep 2020 19:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600394555; cv=none; d=google.com; s=arc-20160816; b=tcomM8j4Qitf3AOZjMYW4lzv/3KdLlIxqJiOhU7xIxVb9uCxtP0wRVMS5hyAFNjiDj oBI2bFRLge2oZiAxYO3yOhHkJ9xw1FtxCtI7ia9RHbuKIOs7qpnIRo++Dgl5/sigT5B2 +NJA/x9+K3Zz1GQq8QFp15YO7VfuiKBswegJdhHrDoTkKdyBJE2lS3hl3xgJ943uLqXm SyeoXmrofwGeXxR/2iA9jRT2n6r5yTE6g6J9Qt8IN4CCS1A1fIaLo9h0hQfIhK7u/VZ3 HX1TYdigp0vScAZTgy9rzK3BCnMv7R/dGlRYYNzq9r94qt+FYo84ryBV3Q+aYnEeiAXP xNyw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=l4FaIm+4qpVaEzKkxB1bZJubPl3G3D8EScTapnfxT3Q=; b=HT3BjRiMN2UOvuynFvVGjK0xjJoZVjWaX8Imanp3vi1z4OY+F9WoxxAOIlJEMieWoH KsbMNwqncA1lGL0COz/P1pJewKrgNE4yFbHb9ulBZ4vqL4Hx6HVQ8wiaYfF7kfuyFk0w p72cX1CQ47oM522nvHOGUIqT9xcNco31aM1FDe35Zr3WpSZLduWoK6F695TrwgOMuwWq chWWOND6xFuUTgbxg0NO9cYi+t0FHZmmb8wQxt3IzAzS4R/mDBTgNo2Uf6lK5n3Fbjeq f7CTNPdZnXaFlEgz/yNcih1UMelkMUFzrqOKHZPZH8PV1cnYAcUdskb4PRQJCcO4lSPr J1LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vqlSMF7H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lo4si1196287ejb.190.2020.09.17.19.02.12; Thu, 17 Sep 2020 19:02:35 -0700 (PDT) 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=vqlSMF7H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726192AbgIRCBN (ORCPT + 99 others); Thu, 17 Sep 2020 22:01:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:45268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbgIRCBM (ORCPT ); Thu, 17 Sep 2020 22:01:12 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C83BF20853; Fri, 18 Sep 2020 02:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394472; bh=YJPAtgg8ivm3iVpE20/kFIelrzzAGemuhbNoSxU16ms=; h=From:To:Cc:Subject:Date:From; b=vqlSMF7HilJT/pNaff65vSD3vwNWGn5l7V22jvkl1n68NsRcHSkMbf/tVM+dK9z5q 97tuFwn7JZRnNEz/DtW4ZQldPZ+Wmqa6QYSTaQrAG9wQudYSoiByWguAThWm9XzCNq aFb2Y0RNWKSS/MZFDYtFysb8wkW4z8AY7QsbZufU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Iago Toral Quiroga , Eric Anholt , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.4 001/330] drm/v3d: don't leak bin job if v3d_job_init fails. Date: Thu, 17 Sep 2020 21:55:41 -0400 Message-Id: <20200918020110.2063155-1-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Iago Toral Quiroga [ Upstream commit 0d352a3a8a1f26168d09f7073e61bb4b328e3bb9 ] If the initialization of the job fails we need to kfree() it before returning. Signed-off-by: Iago Toral Quiroga Signed-off-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20190916071125.5255-1-itoral@igalia.com Fixes: a783a09ee76d ("drm/v3d: Refactor job management.") Reviewed-by: Eric Anholt Signed-off-by: Sasha Levin --- 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 19c092d75266b..6316bf3646af5 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -565,6 +565,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); kfree(bin); return ret; -- 2.25.1