linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] EDAC/altera: Initialize peripheral FIFOs in probe()
@ 2023-04-19 14:33 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-04-19 14:33 UTC (permalink / raw)
  To: thor.thayer; +Cc: linux-edac

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-19 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19 14:33 [bug report] EDAC/altera: Initialize peripheral FIFOs in probe() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).