[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-edac
Subject:    [bug report] EDAC/altera: Initialize peripheral FIFOs in probe()
From:       Dan Carpenter <dan.carpenter () linaro ! org>
Date:       2023-04-19 14:33:08
Message-ID: 0a108941-4158-4dbe-a993-691c7c8fb338 () kili ! mountain
[Download RAW message or body]

Hello Thor Thayer,

The patch 788586efd116: "EDAC/altera: Initialize peripheral FIFOs in
probe()" from Mar 26, 2019, leads to the following Smatch static
checker warning:

drivers/edac/altera_edac.c:1650 socfpga_init_sdmmc_ecc()
warn: inconsistent refcounting 'child->kobj.kref.refcount.refs.counter':
  inc on: 1646
  dec on: 1650

drivers/edac/altera_edac.c
    1624 static int __init socfpga_init_sdmmc_ecc(struct altr_edac_device_dev *device)
    1625 {
    1626         int rc = -ENODEV;
    1627         struct device_node *child;
    1628 
    1629         child = of_find_compatible_node(NULL, NULL, "altr,socfpga-sdmmc-ecc");
    1630         if (!child)
    1631                 return -ENODEV;
    1632 
    1633         if (!of_device_is_available(child))
    1634                 goto exit;
    1635 
    1636         if (validate_parent_available(child))
    1637                 goto exit;
    1638 
    1639         /* Init portB */
    1640         rc = altr_init_a10_ecc_block(child, ALTR_A10_SDMMC_IRQ_MASK,
    1641                                      a10_sdmmceccb_data.ecc_enable_mask, 1);
    1642         if (rc)
    1643                 goto exit;
    1644 
    1645         /* Setup portB */
    1646         return altr_portb_setup(device);

Should we call of_node_put() if altr_portb_setup() fails?

    1647 
    1648 exit:
    1649         of_node_put(child);
--> 1650         return rc;
    1651 }

regards,
dan carpenter
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic