From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B06E73F8896; Wed, 20 May 2026 18:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301671; cv=none; b=k+c81oicex7aGpEprWLThadq0D3EppbjPx+2zCdfGNDEjGtnAcDcUvKUkCI66gH71ZoMXkyi7NzoA5Xv40QSQCbAUnYKKJXHRO66UrhdEwQqKpw4ZfZgnb0Q69CWVef0NCN5baFrxs5j6dJsVtP4q720m015FzD5pqBmUz2pG+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301671; c=relaxed/simple; bh=epH4aEpfLFLoEwQMucsL2ywwnPGLbY8FUS6LOLQ5RQs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HebkP4L88CHiEo1MqkYJWIFTtFL7Vtk4J6mfmZ9hHtr6ECGPPRoQMn/W+XKAlBAd+5/In20ApCS/Ue0tiS+wEX3XWWSWVwTxNgO+fXIWAr8BAKgCsgn6cb9mesFBpJZBxXEYjA4E1Ae5pN+6CccXOPrQEXsgq8FwhYjELJHmPLo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IxJy05Df; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IxJy05Df" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 223BB1F000E9; Wed, 20 May 2026 18:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779301670; bh=nYMtDtCYYzqoCMT9cT8gEcdYANTsZrhe0196p7T2GB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IxJy05DfJ1jeoaUw6zn7VtTml1rFri3N3C44Xxb8pk3gGwgNbKMxq7UKYT8yJHD3Z Vk/L7e/AhUb8N0BJWM/i6tp4w6rzsS2sLyWcDy+FdNNNy6DkyzTSJwMtZy11O4xnib cNv+frUKaUftLBkWVxGvmnriWoPOpd+l0uNxXVps= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gyeyoung Baek , =?UTF-8?q?Adri=C3=A1n=20Larumbe?= , Boris Brezillon , Steven Price Subject: [PATCH 6.12 642/666] drm/panfrost: Fix wait_bo ioctl leaking positive return from dma_resv_wait_timeout() Date: Wed, 20 May 2026 18:24:13 +0200 Message-ID: <20260520162125.193114585@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gyeyoung Baek commit 459d75523b71c0ec254d153d8850d0b7008af396 upstream. dma_resv_wait_timeout() returns a positive 'remaining jiffies' value on success, 0 on timeout, and -errno on failure. panfrost_ioctl_wait_bo() returns this 'long' result from an int-typed ioctl handler, so positive values reach userspace as bogus errors. Explicitly set ret to 0 on the success path. Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") Cc: stable@vger.kernel.org Signed-off-by: Gyeyoung Baek Reviewed-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patch.msgid.link/fe33f82fded7be1c18e2e0eb2db451d5a738cf39.1776581974.git.gye976@gmail.com Signed-off-by: Steven Price Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -325,6 +325,8 @@ panfrost_ioctl_wait_bo(struct drm_device true, timeout); if (!ret) ret = timeout ? -ETIMEDOUT : -EBUSY; + else if (ret > 0) + ret = 0; drm_gem_object_put(gem_obj);