From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47A49448D00 for ; Wed, 15 Jul 2026 12:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784117757; cv=none; b=lH938f+8qrn4C9U65YXDJlrcB2KN2rmtezgczh3lITB6HouvuCbUw1idNujPl7egPY3YFy/W2hFeASTPErlizgtpghMqqFgyAfl542X8+K4umaH7R3+a9ucPWr0EK+d6At1xwwc9RADvqpWhKFOlN+Ahzrs4WZrv2z/NCjnC/rE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784117757; c=relaxed/simple; bh=vXG343RvxNMvT1nDir7w8C4UE4dEAOD/jXueka6+NUA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=euIvEmWurVKrfqTKusB/vtfIdvW3LsiNUOa2cK+dbsnzGlswSnrNcUa9RqVQEkDEwDrVHmOoEYp6d4vkoWilgxyqryi7gyQNc/VbhbYyddPbDf0DKt8mBozpuMy6CBO5HF/8s8ucbqQE6Fcq3l1Ps1y1kqIAtWuo/Cilcg28M2Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=AbdTRcOL; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="AbdTRcOL" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 739E22F for ; Wed, 15 Jul 2026 05:15:51 -0700 (PDT) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7FC323F7B4 for ; Wed, 15 Jul 2026 05:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784117755; bh=vXG343RvxNMvT1nDir7w8C4UE4dEAOD/jXueka6+NUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AbdTRcOLQ65keseNoFpzFQW7pXhDMmNKyTx2+tk0WCkdbqW0AGqqNpmhYMiGJLiO+ knIJu/CYsI7Nsmgy/n43EB5uC7URpduC5ARxSHPm7zdlTvyQpBP9fGVwScuJkzQTFF qdcA37mwUq9G7PdQSvKTci0bjP8tCG3QPbuvUdrU= Date: Wed, 15 Jul 2026 13:15:42 +0100 From: Liviu Dudau To: Linmao Li Cc: Boris Brezillon , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , =?utf-8?Q?Adri=C3=A1n?= Larumbe , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/panthor: Check debugfs GEM lock initialization Message-ID: References: <20260713082912.321021-1-lilinmao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260713082912.321021-1-lilinmao@kylinos.cn> On Mon, Jul 13, 2026 at 04:29:12PM +0800, Linmao Li wrote: > drmm_mutex_init() can fail while registering the managed cleanup action. > When that happens, drmm_add_action_or_reset() destroys the mutex before > returning the error. Continuing initialization would therefore leave the > debugfs GEM object list with an unusable lock. > > Propagate the error as is already done for the other managed mutexes in > panthor_device_init(). > > Fixes: a3707f53eb3f ("drm/panthor: show device-wide list of DRM GEM objects over DebugFS") > Signed-off-by: Linmao Li Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_device.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c > index 0b25abebb803..9687c59de350 100644 > --- a/drivers/gpu/drm/panthor/panthor_device.c > +++ b/drivers/gpu/drm/panthor/panthor_device.c > @@ -182,7 +182,10 @@ int panthor_device_init(struct panthor_device *ptdev) > return ret; > > #ifdef CONFIG_DEBUG_FS > - drmm_mutex_init(&ptdev->base, &ptdev->gems.lock); > + ret = drmm_mutex_init(&ptdev->base, &ptdev->gems.lock); > + if (ret) > + return ret; > + > INIT_LIST_HEAD(&ptdev->gems.node); > #endif > > -- > 2.25.1 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯