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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202204290610.SVJgr8qV-lkp@intel.com>
Date:   Fri, 29 Apr 2022 13:30:14 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Fabio Estevam <festevam@...il.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Sakari Ailus <sakari.ailus@...ux.intel.com>
Subject: [sailus-media-tree:master 55/60] drivers/media/i2c/adv7180.c:573
 adv7180_test_pattern() error: uninitialized symbol 'reg'.

tree:   git://linuxtv.org/sailus/media_tree.git master
head:   ea1280040a678f38a4ce6f1817933c04cfe74552
commit: f3b4b140d87dc7f256229f20a8d70429a7549aca [55/60] media: i2c: adv7180: Add support for the test patterns
config: microblaze-randconfig-m031-20220427 (https://download.01.org/0day-ci/archive/20220429/202204290610.SVJgr8qV-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

smatch warnings:
drivers/media/i2c/adv7180.c:573 adv7180_test_pattern() error: uninitialized symbol 'reg'.

vim +/reg +573 drivers/media/i2c/adv7180.c

f3b4b140d87dc7f Fabio Estevam 2022-04-27  563  static int adv7180_test_pattern(struct adv7180_state *state, int value)
f3b4b140d87dc7f Fabio Estevam 2022-04-27  564  {
f3b4b140d87dc7f Fabio Estevam 2022-04-27  565  	unsigned int reg;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  566  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  567  	/* Map menu value into register value */
f3b4b140d87dc7f Fabio Estevam 2022-04-27  568  	if (value < 3)
f3b4b140d87dc7f Fabio Estevam 2022-04-27  569  		reg = value;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  570  	if (value == 3)
f3b4b140d87dc7f Fabio Estevam 2022-04-27  571  		reg = 5;

Just write something like:

	if (value < 3)
		reg = value;
	else
		reg = 3;

f3b4b140d87dc7f Fabio Estevam 2022-04-27  572  
f3b4b140d87dc7f Fabio Estevam 2022-04-27 @573  	adv7180_write(state, ADV7180_REG_ANALOG_CLAMP_CTL, reg);
                                                                                                   ^^^
Uninitialized

f3b4b140d87dc7f Fabio Estevam 2022-04-27  574  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  575  	if (value == ARRAY_SIZE(test_pattern_menu) - 1) {
f3b4b140d87dc7f Fabio Estevam 2022-04-27  576  		reg = adv7180_read(state, ADV7180_REG_DEF_VALUE_Y);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  577  		reg &= ~ADV7180_DEF_VAL_EN;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  578  		adv7180_write(state, ADV7180_REG_DEF_VALUE_Y, reg);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  579  		return 0;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  580  	}
f3b4b140d87dc7f Fabio Estevam 2022-04-27  581  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  582  	reg = adv7180_read(state, ADV7180_REG_DEF_VALUE_Y);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  583  	reg |= ADV7180_DEF_VAL_EN | ADV7180_DEF_VAL_AUTO_EN;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  584  	adv7180_write(state, ADV7180_REG_DEF_VALUE_Y, reg);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  585  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  586  	return 0;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  587  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ