netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	"David S. Miller" <davem@davemloft.net>,
	Igal Liberman <igal.liberman@freescale.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH] fsl/fman: Delete one function call "put_device" in dtsec_config()
Date: Thu, 14 Jan 2016 17:27:41 +0100	[thread overview]
Message-ID: <20160114162741.GC19773@lunn.ch> (raw)
In-Reply-To: <5697B81E.4050303@users.sourceforge.net>

On Thu, Jan 14, 2016 at 04:00:46PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 14 Jan 2016 15:46:28 +0100
> 
> The Coccinelle semantic patch script "deref_null.cocci" pointed a problem
> out in the implementation of the function "dtsec_config".
> 
> A null pointer was assigned to the data structure member "tbiphy" of the
> variable "dtsec" if a matching device was not found.
> A call of the function "put_device" was unnecessary then because
> a previous call of the function "get_device" was not triggered.
> Thus remove the function call "put_device" after the printing of the
> desired error message.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support")
Reviewd-by: Andrew Lunn <andrew@lunn.ch>

	    Andrew
> ---
>  drivers/net/ethernet/freescale/fman/fman_dtsec.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
> index 6b1261c..7c92eb8 100644
> --- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c
> +++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
> @@ -1434,7 +1434,6 @@ struct fman_mac *dtsec_config(struct fman_mac_params *params)
>  	dtsec->tbiphy = of_phy_find_device(params->internal_phy_node);
>  	if (!dtsec->tbiphy) {
>  		pr_err("of_phy_find_device (TBI PHY) failed\n");
> -		put_device(&dtsec->tbiphy->mdio.dev);
>  		goto err_dtsec_drv_param;
>  	}
>  
> -- 
> 2.6.3
> 

  reply	other threads:[~2016-01-14 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 21:20 fsl/fman: Clarification for implementation details in dtsec_config() SF Markus Elfring
2016-01-13 21:35 ` Dan Carpenter
2016-01-13 22:09   ` Andrew Lunn
2016-01-14 15:00     ` [PATCH] fsl/fman: Delete one function call "put_device" " SF Markus Elfring
2016-01-14 16:27       ` Andrew Lunn [this message]
2016-01-14 21:51       ` 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=20160114162741.GC19773@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=elfring@users.sourceforge.net \
    --cc=igal.liberman@freescale.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.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).