[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141007.000754.1011567266866832634.davem@davemloft.net>
Date: Tue, 07 Oct 2014 00:07:54 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: pgynther@...gle.com
Cc: netdev@...r.kernel.org, f.fainelli@...il.com,
thomas.petazzoni@...e-electrons.com
Subject: Re: [PATCH v2 net-next] net: phy: adjust fixed_phy_register()
return value
From: Petri Gynther <pgynther@...gle.com>
Date: Mon, 6 Oct 2014 11:38:30 -0700 (PDT)
> Adjust fixed_phy_register() to return struct phy_device *, so that
> it becomes easy to use fixed PHYs without device tree support:
>
> phydev = fixed_phy_register(PHY_POLL, &fixed_phy_status, NULL);
> fixed_phy_set_link_update(phydev, fixed_phy_link_update);
> phy_connect_direct(netdev, phydev, handler_fn, phy_interface);
>
> This change is a prerequisite for modifying bcmgenet driver to work
> without a device tree on Broadcom's MIPS-based 7xxx platforms.
>
> Signed-off-by: Petri Gynther <pgynther@...gle.com>
If the caller gets this 'phy' pointer and does something with it,
something seems amiss.
We don't hold an extra reference to the 'phy' object for the caller,
so another thread of control can unregister it and kill that last
reference and therefore free it up.
I think to be legitimate, you have to hold an extra reference on
'phy' for the caller. And now that means that code paths that
don't need to do anything with 'phy' now will need to release
that reference.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists