public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ma Ke <make24@iscas.ac.cn>,
	kristo@kernel.org, bp@alien8.de, tony.luck@intel.com,
	james.morse@arm.com, mchehab@kernel.org, rric@kernel.org,
	akpm@linux-foundation.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ma Ke <make24@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: Re: [PATCH v4 RESEND] EDAC/ti: Fix possible null pointer dereference in _emif_get_id()
Date: Fri, 16 Aug 2024 09:39:48 +0800	[thread overview]
Message-ID: <202408160935.A6QFliqt-lkp@intel.com> (raw)
In-Reply-To: <20240815014511.147065-1-make24@iscas.ac.cn>

Hi Ma,

kernel test robot noticed the following build warnings:

[auto build test WARNING on ras/edac-for-next]
[also build test WARNING on linus/master v6.11-rc3 next-20240815]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ma-Ke/EDAC-ti-Fix-possible-null-pointer-dereference-in-_emif_get_id/20240815-094801
base:   https://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
patch link:    https://lore.kernel.org/r/20240815014511.147065-1-make24%40iscas.ac.cn
patch subject: [PATCH v4 RESEND] EDAC/ti: Fix possible null pointer dereference in _emif_get_id()
config: arm-randconfig-002-20240816 (https://download.01.org/0day-ci/archive/20240816/202408160935.A6QFliqt-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project f86594788ce93b696675c94f54016d27a6c21d18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240816/202408160935.A6QFliqt-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408160935.A6QFliqt-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/edac/ti_edac.c:28:
   In file included from drivers/edac/edac_module.h:15:
   In file included from drivers/edac/edac_mc.h:30:
   In file included from include/linux/pci.h:1646:
   In file included from include/linux/dmapool.h:14:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/edac/ti_edac.c:214:14: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
     214 |         if (my_addr == OF_BAD_ADDR)
         |             ~~~~~~~ ^  ~~~~~~~~~~~
   drivers/edac/ti_edac.c:226:12: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
     226 |                 if (addr == OF_BAD_ADDR)
         |                     ~~~~ ^  ~~~~~~~~~~~
   3 warnings generated.


vim +214 drivers/edac/ti_edac.c

   201	
   202	static int _emif_get_id(struct device_node *node)
   203	{
   204		struct device_node *np;
   205		const __be32 *addrp;
   206		u32 addr, my_addr;
   207		int my_id = 0;
   208	
   209		addrp = of_get_address(node, 0, NULL, NULL);
   210		if (!addrp)
   211			return -EINVAL;
   212	
   213		my_addr = (u32)of_translate_address(node, addrp);
 > 214		if (my_addr == OF_BAD_ADDR)
   215			return -EINVAL;
   216	
   217		for_each_matching_node(np, ti_edac_of_match) {
   218			if (np == node)
   219				continue;
   220	
   221			addrp = of_get_address(np, 0, NULL, NULL);
   222			if (!addrp)
   223				return -EINVAL;
   224	
   225			addr = (u32)of_translate_address(np, addrp);
   226			if (addr == OF_BAD_ADDR)
   227				return -EINVAL;
   228	
   229			edac_printk(KERN_INFO, EDAC_MOD_NAME,
   230				    "addr=%x, my_addr=%x\n",
   231				    addr, my_addr);
   232	
   233			if (addr < my_addr)
   234				my_id++;
   235		}
   236	
   237		return my_id;
   238	}
   239	

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

      reply	other threads:[~2024-08-16  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15  1:45 [PATCH v4 RESEND] EDAC/ti: Fix possible null pointer dereference in _emif_get_id() Ma Ke
2024-08-16  1:39 ` kernel test robot [this message]

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=202408160935.A6QFliqt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=kristo@kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=make24@iscas.ac.cn \
    --cc=mchehab@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rric@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tony.luck@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox