[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRY5mY914cSPoqY8@google.com>
Date: Fri, 14 Nov 2025 04:03:37 +0800
From: Kuan-Wei Chiu <visitorckw@...il.com>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] debug: Fix a mixed use of NULL and error pointers
Hi Haotian,
On Tue, Nov 11, 2025 at 10:15:21AM +0800, Haotian Zhang wrote:
> The lookup_object_or_alloc() function currently returns either error
> pointers (ERR_PTR(-ENOENT)) or NULL on allocation failure. Mixing error
> pointers and NULL is confusing and makes the code harder to maintain.
> Change lookup_object_or_alloc() to consistently return error pointers
> for all error cases by returning ERR_PTR(-ENOMEM) instead of NULL when
> allocation fails.
>
> Update all three call sites (__debug_object_init, debug_object_activate,
> and debug_object_assert_init) to use IS_ERR() for error checking and
> handle -ENOMEM by calling debug_objects_oom().
>
> Fixes: 63a759694eed ("debugobject: Prevent init race with static objects")
> Suggested-by: Kuan-Wei Chiu <visitorckw@...il.com>
> Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
Nit: The majority of the past git commit history uses debugobjects: as
the subject line prefix rather than debug:
Regards,
Kuan-Wei
Powered by blists - more mailing lists