From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2A0D2185B1; Thu, 12 Dec 2024 15:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734018016; cv=none; b=hYYSkb3xmVfej9wAUWM14ijqtgTvICYyDHxO8hW2B89Kc5+pFG1qnZZN0hhN5ruXLK2HfovWDRiS2p9i1u+Md9Y9b9KRugB4rq6+HLr5gOgoW31FR8jITDXRg/MContcBup++0noK+4DzFImKx9oH28nzNQu8yiQ5LL0n4yUBII= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734018016; c=relaxed/simple; bh=Gs8qh/0s5ADeRZUmnid0L9Vu4uwO7vmvWMpPMbdS9xo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JJIYdC1sEBIgf5Um5cItiSn7zKEUQn0Ze4K8hos/63UwDuaNbFXCqSOyeihFPyf5NM0mHpun3LRtsrw9dcHmqmctgDXJ2iZAmEadWnVG1zq2SJGQB2QtOn8resckJC7qR0caOWvFF+ien3hm9X1Y6GpePjAHh5S2JJYqsnrzg0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=w3akWgNJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="w3akWgNJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EFFEC4CED4; Thu, 12 Dec 2024 15:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734018015; bh=Gs8qh/0s5ADeRZUmnid0L9Vu4uwO7vmvWMpPMbdS9xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w3akWgNJEZVjVdNzdcJsN9u1uDhDTDFhZPsh7uG0DiQv16iNKmOchZ3depa91mTao Kmz1l7zRgpqP8kQWtPjLDjDPhTGW37NGBA9ijRWt8wCYHgt8MB/yCDLqmoRqAebpkM 9Xim4Edl06kjwOAu2RIY5r4vL8JGJfNfON36WtXI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tvrtko Ursulin , =?UTF-8?q?Christian=20K=C3=B6nig?= , Daniel Vetter , Sumit Semwal , Gustavo Padovan , Friedrich Vock , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH 6.6 174/356] dma-fence: Fix reference leak on fence merge failure path Date: Thu, 12 Dec 2024 15:58:13 +0100 Message-ID: <20241212144251.508143942@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144244.601729511@linuxfoundation.org> References: <20241212144244.601729511@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tvrtko Ursulin commit 949291c5314009b4f6e252391edbb40fdd5d5414 upstream. Release all fence references if the output dma-fence-array could not be allocated. Signed-off-by: Tvrtko Ursulin Fixes: 245a4a7b531c ("dma-buf: generalize dma_fence unwrap & merging v3") Cc: Christian König Cc: Daniel Vetter Cc: Sumit Semwal Cc: Gustavo Padovan Cc: Friedrich Vock Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Cc: # v6.0+ Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20241115102153.1980-2-tursulin@igalia.com Signed-off-by: Greg Kroah-Hartman --- drivers/dma-buf/dma-fence-unwrap.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/dma-buf/dma-fence-unwrap.c +++ b/drivers/dma-buf/dma-fence-unwrap.c @@ -164,6 +164,8 @@ restart: dma_fence_context_alloc(1), 1, false); if (!result) { + for (i = 0; i < count; i++) + dma_fence_put(array[i]); tmp = NULL; goto return_tmp; }