linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: David Miller <davem@davemloft.net>,
	julia.lawall@lip6.fr, jon.mason@broadcom.com
Cc: netdev@vger.kernel.org, jon.mason@broadcom.com, andrew@lunn.ch,
	kbuild-all@01.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mdio: mux: fix device_node_continue.cocci warnings
Date: Fri, 12 May 2017 15:52:25 -0700	[thread overview]
Message-ID: <872f3980-9faa-718f-3260-9e4b22946140@gmail.com> (raw)
In-Reply-To: <20170512.122223.341607427763777325.davem@davemloft.net>

On 05/12/2017 09:22 AM, David Miller wrote:
> From: Julia Lawall <julia.lawall@lip6.fr>
> Date: Fri, 12 May 2017 22:54:23 +0800 (SGT)
> 
>> Device node iterators put the previous value of the index variable, so an
>> explicit put causes a double put.
>  ...
>> @@ -169,7 +169,6 @@ int mdio_mux_init(struct device *dev,
>>  		if (r) {
>>  			mdiobus_free(cb->mii_bus);
>>  			devm_kfree(dev, cb);
>> -			of_node_put(child_bus_node);
>>  		} else {
> 
> I think we're instead simply missing a break; statement here.

It's kind of questionable, if we have an error initializing one of our
child MDIO bus controller (child from the perspective of the MDIO mux,
boy this is getting complicated...), should we keep on going, or should
we abort entirely and rollback what we have successfully registered?

I don't think Julia's patch makes thing worse, in that if we had to
rollback, we would not be doing this correctly now anyway.

Jon, what do you think?
-- 
Florian

  reply	other threads:[~2017-05-12 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 14:54 [PATCH] mdio: mux: fix device_node_continue.cocci warnings Julia Lawall
2017-05-12 16:22 ` David Miller
2017-05-12 22:52   ` Florian Fainelli [this message]
2017-05-13  0:40     ` Julia Lawall
2017-05-15 17:37     ` Jon Mason
2017-05-15 18:29       ` David Miller

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=872f3980-9faa-718f-3260-9e4b22946140@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=jon.mason@broadcom.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 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).