lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4aee1b4f-b176-46c4-841d-6bf6c91c6799@suswa.mountain>
Date: Thu, 31 Jul 2025 18:58:50 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Marc Zyngier <maz@...nel.org>
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: drivers/irqchip/irq-riscv-imsic-platform.c:317
 imsic_irqdomain_init() warn: variable dereferenced before check 'imsic' (see
 line 311)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   260f6f4fda93c8485c8037865c941b42b9cba5d2
commit: 59422904dd9855f94d00dc66598bef1bd2663894 irqchip/riscv-imsic: Convert to msi_create_parent_irq_domain() helper
config: riscv-randconfig-r073-20250731 (https://download.01.org/0day-ci/archive/20250731/202507311953.NFVZkr0a-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 8.5.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@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202507311953.NFVZkr0a-lkp@intel.com/

smatch warnings:
drivers/irqchip/irq-riscv-imsic-platform.c:317 imsic_irqdomain_init() warn: variable dereferenced before check 'imsic' (see line 311)

vim +/imsic +317 drivers/irqchip/irq-riscv-imsic-platform.c

027e125acdbad7 Anup Patel   2024-03-07  308  int imsic_irqdomain_init(void)
027e125acdbad7 Anup Patel   2024-03-07  309  {
59422904dd9855 Marc Zyngier 2025-06-26  310  	struct irq_domain_info info = {
59422904dd9855 Marc Zyngier 2025-06-26 @311  		.fwnode		= imsic->fwnode,
                                                                          ^^^^^^^^^^^^^^
Dereference

59422904dd9855 Marc Zyngier 2025-06-26  312  		.ops		= &imsic_base_domain_ops,
59422904dd9855 Marc Zyngier 2025-06-26  313  		.host_data	= imsic,
59422904dd9855 Marc Zyngier 2025-06-26  314  	};
027e125acdbad7 Anup Patel   2024-03-07  315  	struct imsic_global_config *global;
027e125acdbad7 Anup Patel   2024-03-07  316  
027e125acdbad7 Anup Patel   2024-03-07 @317  	if (!imsic || !imsic->fwnode) {
                                                    ^^^^^^
Checked too late.

027e125acdbad7 Anup Patel   2024-03-07  318  		pr_err("early driver not probed\n");
027e125acdbad7 Anup Patel   2024-03-07  319  		return -ENODEV;
027e125acdbad7 Anup Patel   2024-03-07  320  	}
027e125acdbad7 Anup Patel   2024-03-07  321  
027e125acdbad7 Anup Patel   2024-03-07  322  	if (imsic->base_domain) {
027e125acdbad7 Anup Patel   2024-03-07  323  		pr_err("%pfwP: irq domain already created\n", imsic->fwnode);
027e125acdbad7 Anup Patel   2024-03-07  324  		return -ENODEV;
027e125acdbad7 Anup Patel   2024-03-07  325  	}

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ