From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/ata/libahci_platform.c:552 ahci_platform_get_resources() warn: passing zero to 'ERR_PTR'
Date: Fri, 19 Nov 2021 00:54:06 +0800 [thread overview]
Message-ID: <202111190054.RrrYLbmr-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4764 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Wang Hai <wanghai38@huawei.com>
CC: Damien Le Moal <damien.lemoal@wdc.com>
CC: Hans de Goede <hdegoede@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42eb8fdac2fc5d62392dcfcf0253753e821a97b0
commit: 776c75010803849c1cc4f11031a2b3960ab05202 ata: ahci_platform: fix null-ptr-deref in ahci_platform_enable_regulators()
date: 5 weeks ago
:::::: branch date: 17 hours ago
:::::: commit date: 5 weeks ago
config: nios2-randconfig-m031-20211118 (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.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/ata/libahci_platform.c:552 ahci_platform_get_resources() warn: passing zero to 'ERR_PTR'
vim +/ERR_PTR +552 drivers/ata/libahci_platform.c
b1a9edbda040a4 Antoine Tenart 2014-07-30 513
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 514 rc = ahci_platform_get_phy(hpriv, port, dev, child);
d7f76f36a8b4dc Nishka Dasgupta 2019-08-15 515 if (rc) {
d7f76f36a8b4dc Nishka Dasgupta 2019-08-15 516 of_node_put(child);
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 517 goto err_out;
d7f76f36a8b4dc Nishka Dasgupta 2019-08-15 518 }
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 519
b1a9edbda040a4 Antoine Tenart 2014-07-30 520 enabled_ports++;
b1a9edbda040a4 Antoine Tenart 2014-07-30 521 }
b1a9edbda040a4 Antoine Tenart 2014-07-30 522 if (!enabled_ports) {
b1a9edbda040a4 Antoine Tenart 2014-07-30 523 dev_warn(dev, "No port enabled\n");
b1a9edbda040a4 Antoine Tenart 2014-07-30 524 rc = -ENODEV;
b1a9edbda040a4 Antoine Tenart 2014-07-30 525 goto err_out;
b1a9edbda040a4 Antoine Tenart 2014-07-30 526 }
b1a9edbda040a4 Antoine Tenart 2014-07-30 527
b1a9edbda040a4 Antoine Tenart 2014-07-30 528 if (!hpriv->mask_port_map)
b1a9edbda040a4 Antoine Tenart 2014-07-30 529 hpriv->mask_port_map = mask_port_map;
b1a9edbda040a4 Antoine Tenart 2014-07-30 530 } else {
b1a9edbda040a4 Antoine Tenart 2014-07-30 531 /*
b1a9edbda040a4 Antoine Tenart 2014-07-30 532 * If no sub-node was found, keep this for device tree
b1a9edbda040a4 Antoine Tenart 2014-07-30 533 * compatibility
b1a9edbda040a4 Antoine Tenart 2014-07-30 534 */
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 535 rc = ahci_platform_get_phy(hpriv, 0, dev, dev->of_node);
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 536 if (rc)
acbd573354bb7b Mikko Perttunen 2014-06-17 537 goto err_out;
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 538
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 539 rc = ahci_platform_get_regulator(hpriv, 0, dev);
c7d7ddee7e24ee Gregory CLEMENT 2015-01-15 540 if (rc == -EPROBE_DEFER)
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 541 goto err_out;
b1a9edbda040a4 Antoine Tenart 2014-07-30 542 }
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 543 pm_runtime_enable(dev);
eac7e072d7e99f Tejun Heo 2018-08-06 544 pm_runtime_get_sync(dev);
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 545 hpriv->got_runtime_pm = true;
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 546
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 547 devres_remove_group(dev, NULL);
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 548 return hpriv;
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 549
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 550 err_out:
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 551 devres_release_group(dev, NULL);
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 @552 return ERR_PTR(rc);
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 553 }
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 554 EXPORT_SYMBOL_GPL(ahci_platform_get_resources);
fd990556f0fa25 Bartlomiej Zolnierkiewicz 2014-03-25 555
:::::: The code at line 552 was first introduced by commit
:::::: fd990556f0fa25446c6bfa9cf4c9e49d387d4472 ata: move library code from ahci_platform.c to libahci_platform.c
:::::: TO: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
:::::: CC: Tejun Heo <tj@kernel.org>
---
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: 25698 bytes --]
next reply other threads:[~2021-11-18 16:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 16:54 kernel test robot [this message]
2021-11-26 11:37 drivers/ata/libahci_platform.c:552 ahci_platform_get_resources() warn: passing zero to 'ERR_PTR' kernel test robot
2022-03-17 23:52 kernel test robot
2022-07-31 7:00 kernel test robot
2022-08-31 1:54 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=202111190054.RrrYLbmr-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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.