From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D92229CEB for ; Thu, 13 Nov 2025 20:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763064223; cv=none; b=Y3CiF1zMILU4SU6CWrqHwOQ5DIZfkS93jw20jFWK/PdlO0sc++ObDox2yOl+5R3hPC2NANlx6LO1DjgkQBEGN9CsYxcoWCeDqgkTsvinY3qkUCJ0iBlc+ZiKul00kb5xRxjA1uP6oJNrycyNB+tHfQ+3bd3S5QjMm/KBwY5mLw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763064223; c=relaxed/simple; bh=g7O1HA3s4p9aIRtwYkWK/JQETrcqrdtI+mjtUlQaO1Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NHtskVneMk0/9H49by4hlK+XpTh7AY1i/6zEWaih63J3SXTvDh3wQvoQL6rmpZJAVc2MmM7CMvIK1Yji3f9TIplow2qCywyPd2GFEU9t6jAF7Hoyvl+F26o6QRewiY3njPJmpZvAPFmgiuqfhOZtAiS88DjgjFm77reQrSuDCTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F+rhTlok; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F+rhTlok" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-7aab061e7cbso1342267b3a.1 for ; Thu, 13 Nov 2025 12:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763064221; x=1763669021; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZCqW9ytSxNzod0uA/nMqodicn020eJmutkftVJNDWnc=; b=F+rhTlokFFP8tk3E9UAIxEJhXCZzLtD4KZcSznme73/NQ34LCQd2ClkIumsrylevPR 8UfBREzt4An/srqkilikFYy+W7XolK8W3AYmLC7bBOMp1dUuD4GGTMfUfOicojAnuBYt EuKWiTRqUF9fi6l/pNItvAYBvLvu0m38ogqsJgdgY/vVPFQ9frJWzr/AahnmkL2S3DjE sQa1YgDWX39JybMm0+2kjp1RuxOwqj9iqZh6luJ13hRvIZfVG69VbF9yAAFEX6M98UHJ zktEPXFUex01hQtKl6ueJW2XOVFPqCsqVkmRkAUn4ONgKDj191O0UeK+Fs93056vJ7G2 K0MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763064221; x=1763669021; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZCqW9ytSxNzod0uA/nMqodicn020eJmutkftVJNDWnc=; b=wTBr2wjzN2ozODopakRigVtLdsa7hLu2/qrjLNcfMy23ppc978iRYORls85WuEt/Ci 2MapmaKrvFQG1ezdb4rLV5Q/Rn6esrNUCn9iapAE/zhGkZ+/Djgwrjfs3FTvXgUVa0QB 1pn4kNvduKoUQuJqAusNif9CTaiZO4DbZibO8lrYKZVg5g43DHDl/SNCs/RvrmlilnpI 495bJAdqJB0+6xiSJHDxQAiMP0pVameOvUpnk78WFpy9PbRTPBlGBWuv7ULLsNYYI7cO 3hyyG/ex9MQe+es+QJNK+yrDWXhgrKbwvElf/C9t/jinrh6CVSyG5TOw5yBw6I6QDksm 6u+A== X-Forwarded-Encrypted: i=1; AJvYcCUqSfedlcO9RLNcxvMwh+xLEmmHtzirv0kRDV7X1HuNMT2exn792n4Wy/jxkDFdtfkkCbovj38XKqFCIsI=@vger.kernel.org X-Gm-Message-State: AOJu0YzhtmuLsSBe7O4EN2k0pFHoIyBm7cSPdR0Jnws0pCY1psxHNHRv bz3tnnw7b5fJT7owvjg5VSVRECm2FVVQW86YClQ3lB5jo9KjnZ32iIyH X-Gm-Gg: ASbGncv3cOFVFD0ViJKPtj1iLG4UBBszuWDTRJiNrbyLPq1p3r8bLS5VJ8w4peNwRyY HDl0hXdV6mlZJpa0vYo7cxQ16uT06wWjIRj8wapCfK26oh3Rqv2mmqTIlpDmMtA1XNaPmrCa1Xr 1oElJLou2tKfM03hAEXpF1WqufhdVjpg3thvwknAML33lBrA1IsaDRNSVtIGS/pXVjYLwZQww8u kX7QS6nIaWEZrY7hX+5G8ZH8tW98QScU8d+Vor/O6Tf6I8ZiAbXUdmqxbG1CmAiwZH5Hrdupzp5 EGLpMoxHI+xH7hz9TR3l2fKRiRjcq9hbNtin/oUER3d8+Y/wUEkfSPbxl90nCA8GKSCFZI8HRCn BXvisZgehIA47ltnr+xsQGiNQtjuowZXEOXjCecVSnCCetmGgI/mDa0iAySEeiwtLaeWNal52Ew 38Tj2ZOcOZ6nxQ34SrmtrGytFU6st6apdS X-Google-Smtp-Source: AGHT+IGYESuPNQSKNInlGMbHQXKFfr1qSOh+fDtqtiglNhfGBV90rgILAzyP23T6FLP1c4MFJpAIrQ== X-Received: by 2002:a05:6a20:244c:b0:33e:eb7a:446b with SMTP id adf61e73a8af0-35ba228cc9bmr917509637.58.1763064220621; Thu, 13 Nov 2025 12:03:40 -0800 (PST) Received: from google.com ([118.150.148.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b9256b58dcsm3077874b3a.32.2025.11.13.12.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 12:03:40 -0800 (PST) Date: Fri, 14 Nov 2025 04:03:37 +0800 From: Kuan-Wei Chiu To: Haotian Zhang Cc: Andrew Morton , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] debug: Fix a mixed use of NULL and error pointers Message-ID: References: <20251110075746.1680-1-vulab@iscas.ac.cn> <20251111021521.1906-1-vulab@iscas.ac.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=us-ascii Content-Disposition: inline In-Reply-To: <20251111021521.1906-1-vulab@iscas.ac.cn> 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 > Signed-off-by: Haotian Zhang Nit: The majority of the past git commit history uses debugobjects: as the subject line prefix rather than debug: Regards, Kuan-Wei