netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fsl/fman: Clarification for implementation details in dtsec_config()
@ 2016-01-13 21:20 SF Markus Elfring
  2016-01-13 21:35 ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2016-01-13 21:20 UTC (permalink / raw)
  To: netdev, Andrew Lunn, Dan Carpenter, David S. Miller,
	Igal Liberman
  Cc: linux-kernel, kernel-janitors, Julia Lawall

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-14 21:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-01-14 21:51       ` David Miller

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).