Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

url:    https://github.com/0day-ci/linux/commits/james-liu-hpe-com/ACPI-OSL-Handle-the-return-value-of-acpi_os_map_generic_address-for-a-non-register-GAS/20211022-091959
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-m021-20211025 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

smatch warnings:
drivers/acpi/osl.c:467 acpi_os_map_generic_address() error: uninitialized symbol 'addr'.

vim +/addr +467 drivers/acpi/osl.c

6915564dc5a8ab Rafael J. Wysocki 2020-09-11  453  void __iomem *acpi_os_map_generic_address(struct acpi_generic_address *gas)
29718521237a1b Myron Stowe       2010-10-21  454  {
bc9ffce27962c0 Myron Stowe       2011-11-07  455  	u64 addr;
29718521237a1b Myron Stowe       2010-10-21  456  
bc9ffce27962c0 Myron Stowe       2011-11-07  457  	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
6915564dc5a8ab Rafael J. Wysocki 2020-09-11  458  		return NULL;
f0340367a7885a James Liu         2021-10-22  459  	/* Handle a non-register GAS (i.e., a pointer to a data structure),
f0340367a7885a James Liu         2021-10-22  460  	 * whose bit width is expected to be 0 according to ACPI spec. 6.4.
f0340367a7885a James Liu         2021-10-22  461  	 * For example, The RegisterRegion field in SET_ERROR_TYPE_WITH_ADDRESS
f0340367a7885a James Liu         2021-10-22  462  	 * points to a data structure whose format is defined in Table 18.30 in
f0340367a7885a James Liu         2021-10-22  463  	 * ACPI Spec. 6.4
f0340367a7885a James Liu         2021-10-22  464  	 */
f0340367a7885a James Liu         2021-10-22  465  	if (!gas->bit_width) {
f0340367a7885a James Liu         2021-10-22  466  		pr_info("Mapping IOMEM for a non-register GAS.\n");
f0340367a7885a James Liu         2021-10-22 @467  		return  acpi_os_map_iomem(addr, sizeof(unsigned long long));
                                                                       ^                  ^^^^
Uninitialized.

f0340367a7885a James Liu         2021-10-22  468  	}
29718521237a1b Myron Stowe       2010-10-21  469  
bc9ffce27962c0 Myron Stowe       2011-11-07  470  	/* Handle possible alignment issues */
bc9ffce27962c0 Myron Stowe       2011-11-07  471  	memcpy(&addr, &gas->address, sizeof(addr));
f0340367a7885a James Liu         2021-10-22  472  	if (!addr)
6915564dc5a8ab Rafael J. Wysocki 2020-09-11  473  		return NULL;
f0340367a7885a James Liu         2021-10-22  474  	else
6915564dc5a8ab Rafael J. Wysocki 2020-09-11  475  		return acpi_os_map_iomem(addr, gas->bit_width / 8);
29718521237a1b Myron Stowe       2010-10-21  476  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux