linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Suren Baghdasaryan <surenb@google.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kent Overstreet <kent.overstreet@linux.dev>
Subject: [linux-next:master 2720/3921] lib/alloc_tag.c:142 alloc_tag_init() warn: passing zero to 'PTR_ERR'
Date: Fri, 5 Apr 2024 09:51:27 +0300	[thread overview]
Message-ID: <6b5281d8-2998-4e66-b65e-45a0e68e5780@moroto.mountain> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8568bb2ccc278f344e6ac44af6ed010a90aa88dc
commit: 9e2dcefa791e9d14006b360fba3455510fd3325d [2720/3921] lib: add allocation tagging support for memory allocation profiling
config: microblaze-randconfig-r081-20240405 (https://download.01.org/0day-ci/archive/20240405/202404051340.7Wo7oiJ5-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 13.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| 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/

smatch warnings:
lib/alloc_tag.c:142 alloc_tag_init() warn: passing zero to 'PTR_ERR'

vim +/PTR_ERR +142 lib/alloc_tag.c

9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  132  static int __init alloc_tag_init(void)
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  133  {
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  134  	const struct codetag_type_desc desc = {
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  135  		.section	= "alloc_tags",
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  136  		.tag_size	= sizeof(struct alloc_tag),
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  137  		.module_unload	= alloc_tag_module_unload,
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  138  	};
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  139  
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  140  	alloc_tag_cttype = codetag_register_type(&desc);
9e2dcefa791e9d Suren Baghdasaryan 2024-03-21  141  	if (IS_ERR_OR_NULL(alloc_tag_cttype))
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This should just be IS_ERR().  I have written a blog that has more
details:

https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/

9e2dcefa791e9d Suren Baghdasaryan 2024-03-21 @142  		return PTR_ERR(alloc_tag_cttype);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



             reply	other threads:[~2024-04-05  6:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  6:51 Dan Carpenter [this message]
2024-04-16 23:57 ` Suren Baghdasaryan
2024-04-17  0:36   ` Suren Baghdasaryan

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=6b5281d8-2998-4e66-b65e-45a0e68e5780@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=surenb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox