]> git.karo-electronics.de Git - linux-beck.git/commitdiff
fsl/fman: Delete one function call "put_device" in dtsec_config()
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 14 Jan 2016 14:46:28 +0000 (15:46 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Jan 2016 20:03:41 +0000 (15:03 -0500)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/fman_dtsec.c

index 6b1261c0b1c26017b6d34d6f4b3e7ceaccb308c9..7c92eb854925a352d52cb234fd2764f608e76caa 100644 (file)
@@ -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;
        }