fsl/fman: Clarification for implementation details in dtsec_config()

From: SF Markus Elfring
Date: Wed Jan 13 2016 - 16:21:17 EST


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