All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, james.liu@hpe.com, rafael@kernel.org,
	lenb@kernel.org
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-acpi@vger.kernel.org, James Liu <james.liu@hpe.com>
Subject: Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS
Date: Tue, 9 Nov 2021 12:41:52 +0300	[thread overview]
Message-ID: <202111090100.tLRnS1DE-lkp@intel.com> (raw)
In-Reply-To: <20211022011833.24308-1-james.liu@hpe.com>

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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@lists.01.org


WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS
Date: Tue, 09 Nov 2021 01:36:28 +0800	[thread overview]
Message-ID: <202111090100.tLRnS1DE-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3717 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211022011833.24308-1-james.liu@hpe.com>
References: <20211022011833.24308-1-james.liu@hpe.com>
TO: james.liu(a)hpe.com
TO: rafael(a)kernel.org
TO: lenb(a)kernel.org
CC: linux-acpi(a)vger.kernel.org
CC: James Liu <james.liu@hpe.com>

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on v5.15 next-20211108]
[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]

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
:::::: branch date: 3 weeks ago
:::::: commit date: 3 weeks ago
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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

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

^1da177e4c3f41 Linus Torvalds    2005-04-16  452  
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));
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  }
6f68c91c55ea35 Myron Stowe       2011-11-07  477  EXPORT_SYMBOL(acpi_os_map_generic_address);
29718521237a1b Myron Stowe       2010-10-21  478  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39140 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS
Date: Tue, 09 Nov 2021 12:41:52 +0300	[thread overview]
Message-ID: <202111090100.tLRnS1DE-lkp@intel.com> (raw)
In-Reply-To: <20211022011833.24308-1-james.liu@hpe.com>

[-- Attachment #1: Type: text/plain, Size: 2928 bytes --]

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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(a)lists.01.org

       reply	other threads:[~2021-11-09  9:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 17:36 kernel test robot [this message]
2021-11-09  9:41 ` [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS Dan Carpenter
2021-11-09  9:41 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2021-10-22  1:18 james.liu
2021-10-22 14:55 ` Rafael J. Wysocki
2021-11-03  6:39   ` James Liu
2021-10-29  6:16 ` [ACPI] f0340367a7: WARNING:at_arch/x86/mm/ioremap.c:#__ioremap_caller kernel test robot
2021-11-05 17:43 ` [PATCH] ACPI: OSL: Handle the return value of acpi_os_map_generic_address() for a non-register GAS kernel test robot
2021-11-05 17:43   ` kernel test robot

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=202111090100.tLRnS1DE-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=james.liu@hpe.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=rafael@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.