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 488AB137750; Sat, 30 May 2026 18:48:58 +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=1780166939; cv=none; b=ZsdhzSRcR2Ym1UC1U0SKq/Xsfl18aR+ZftUNvJ/wBiSo1yzUl1KZu71UFMTj5sPfsOb3KBO8e9d49GJlb3dvlzjD6hObk5MA6LhKlT229vbAvOfpyE6cmVAvU62s6tFXsGMs2PR3uNo0oTHLH+yaGovL6RSeWYAhipbKQ4OBGT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780166939; c=relaxed/simple; bh=1QIZi4li5Vg4XXLFbceTVmJNf/sjzva2DZmg2ayJ9k4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G5LLmwAZDueV+rD9Vc2fb2m91hQkvM/SDYwvROB50Njn8KWLvThFfZWBBgvqXPWtMKMh7/hG3kss+pYYMXlNqY6u80/n3s9lPLSDIl0XXQUtrvAYwbzPXTX7R7e+vAA8w1hJIc2PaKVp8zUp+29K1uPorAMIJMoryD0er9b5kjs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R01jJ/LY; 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="R01jJ/LY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CC581F00893; Sat, 30 May 2026 18:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780166938; bh=oRj1wxTnEQbQjASuSt3oNsBEONrPC7RwUHuRJSWFMWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R01jJ/LYDHqH+twjnpSRmNpsjr3j1L8mb41k3jkHUPBdIJm57aShmtnI5h6sMwgMa JaOzwFizqakEvpR3qE7puJsLxTazQr6Le/us5EDwpJb2Ph0ghSGr8phlVoxaObsVsB foRs9m+fwLv7+fW+vWNtHHXi2VHE5Ke5/kDBD9H4= 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 5.10 517/589] drm/panfrost: Fix wait_bo ioctl leaking positive return from dma_resv_wait_timeout() Date: Sat, 30 May 2026 18:06:38 +0200 Message-ID: <20260530160238.215444751@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-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 @@ -324,6 +324,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);