NetBSD Problem Report #61131

From www@netbsd.org  Sat Dec  5 05:22:34 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 99CB21A923B
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  5 Dec 2026 05:22:34 +0000 (UTC)
Message-Id: <20261205052233.21A7F1A923D@mollari.NetBSD.org>
Date: Sat,  5 Dec 2026 05:22:33 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: drm: fence indexing typo
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>

>Number:         61131
>Category:       kern
>Synopsis:       drm: fence indexing typo
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 05 05:25:00 +0000 2026
>Closed-Date:    
>Last-Modified:  Sat Dec 05 05:30:03 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10
>Organization:
The FenceBSD Indexing, Inc.
>Environment:
>Description:
    950 	/*
    951 	 * Test whether any of the fences has been signalled.  If they
    952 	 * have, return success.
    953 	 */
    954 	for (j = 0; j < nfences; j++) {
==> 955 		if (dma_fence_is_signaled(fences[i])) {
    956 			if (ip)
    957 				*ip = j;
    958 			ret = MAX(1, timeout);
    959 			goto out;
    960 		}
    961 	}

https://nxr.netbsd.org/xref/src/sys/external/bsd/drm2/linux/linux_dma_fence.c?r=1.42#950

Reported by D Benali.
>How-To-Repeat:
use amdgpu, probably
>Fix:
fences[j], not fences[i]

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 05 Dec 2026 05:29:04 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-11, pullup-10


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61131 CVS commit: src/sys/external/bsd/drm2/linux
Date: Sat, 5 Dec 2026 05:28:32 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat Dec  5 05:28:32 UTC 2026

 Modified Files:
 	src/sys/external/bsd/drm2/linux: linux_dma_fence.c

 Log Message:
 drm: Fix indexing typo in dma_fence_wait_any_timeout.

 PR kern/61131: drm: fence indexing typo


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/sys/external/bsd/drm2/linux/linux_dma_fence.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.