From: SF Markus Elfring <elfring@users.sourceforge.net>
To: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Dan Carpenter <dan.carpenter@oracle.com>,
"David S. Miller" <davem@davemloft.net>,
Igal Liberman <igal.liberman@freescale.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: fsl/fman: Clarification for implementation details in dtsec_config()
Date: Wed, 13 Jan 2016 22:20:45 +0100 [thread overview]
Message-ID: <5696BFAD.9030905@users.sourceforge.net> (raw)
Hello,
The Coccinelle semantic patch "deref_null.cocci" pointed out a potential
problem in the implementation of the function "dtsec_config" (lines 1434-1439):
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/freescale/fman/fman_dtsec.c?id=e5a03bfd873c29eb786655ef2e95e53ed242b404#n1434
…
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;
}
…
If the pointer "dtsec->tbiphy" is NULL, then it will especially matter
if the shown address computation will succeed.
Should the call of the function "put_device" be removed,
or was another argument intended?
Regards,
Markus
next reply other threads:[~2016-01-13 21:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 21:20 SF Markus Elfring [this message]
2016-01-13 21:35 ` fsl/fman: Clarification for implementation details in dtsec_config() 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
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=5696BFAD.9030905@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.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).