All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: akpm@linux-foundation.org
Cc: kent.overstreet@linux.dev, dan.carpenter@linaro.org,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Suren Baghdasaryan <surenb@google.com>,
	 kernel test robot <lkp@intel.com>
Subject: [PATCH 1/1] lib: fix alloc_tag_init() to prevent passing NULL to PTR_ERR()
Date: Tue, 16 Apr 2024 17:33:49 -0700	[thread overview]
Message-ID: <20240417003349.2520094-1-surenb@google.com> (raw)

codetag_register_type() never returns NULL, yet IS_ERR_OR_NULL() is used
to check its return value. This leads to a warning about possibility of
passing NULL to PTR_ERR(). Fix that by using IS_ERR() to exclude NULL.

Fixes: 6e8a230a6b1a ("lib: add allocation tagging support for memory allocation profiling")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202404051340.7Wo7oiJ5-lkp@intel.com/
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
---
 lib/alloc_tag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c
index b37e3430ed92..26af9982ddc4 100644
--- a/lib/alloc_tag.c
+++ b/lib/alloc_tag.c
@@ -233,7 +233,7 @@ static int __init alloc_tag_init(void)
 	};
 
 	alloc_tag_cttype = codetag_register_type(&desc);
-	if (IS_ERR_OR_NULL(alloc_tag_cttype))
+	if (IS_ERR(alloc_tag_cttype))
 		return PTR_ERR(alloc_tag_cttype);
 
 	if (!mem_profiling_support)

base-commit: 6723e3b1a668df6b8f305dea8fb62789155d965f
-- 
2.44.0.769.g3c40516874-goog


                 reply	other threads:[~2024-04-17  0:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417003349.2520094-1-surenb@google.com \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.