Re: [PATCH net-next v3 3/5] net: pcs: qcom-ipq9574: Add PCS instantiation and phylink operations
From: Andrew Lunn
Date: Tue Dec 24 2024 - 10:42:08 EST
> > +static int ipq_pcs_create_miis(struct ipq_pcs *qpcs)
> > +{
> > + struct device *dev = qpcs->dev;
> > + struct ipq_pcs_mii *qpcs_mii;
> > + struct device_node *mii_np;
> > + u32 index;
> > + int ret;
> > +
> > + for_each_available_child_of_node(dev->of_node, mii_np) {
> > + ret = of_property_read_u32(mii_np, "reg", &index);
> > + if (ret) {
> > + dev_err(dev, "Failed to read MII index\n");
> > + of_node_put(mii_np);
>
> Assume, the second child node failed here.
> Returning without calling the first child node of_node_put().
>
> Please clear the previous child nodes resources before return.
>
> Thanks & Regards,
> Manikanta.
Please always trim the text when reviewing. It can be hard to find the
comments, and they can be missed when there is 300 lines of quoted
text you need to page down/page down/page down...
Andrew