BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Wang Hai <[email protected]>
CC: Damien Le Moal <[email protected]>
CC: Hans de Goede <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   dcf8e5633e2e69ad60b730ab5905608b756a032f
commit: 776c75010803849c1cc4f11031a2b3960ab05202 ata: ahci_platform: fix 
null-ptr-deref in ahci_platform_enable_regulators()
date:   11 months ago
:::::: branch date: 29 hours ago
:::::: commit date: 11 months ago
config: xtensa-randconfig-m031-20220830 
(https://download.01.org/0day-ci/archive/20220831/[email protected]/config)
compiler: xtensa-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

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 <[email protected]>
:::::: CC: Tejun Heo <[email protected]>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to