Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread Johan Hovold
On Tue, Nov 01, 2016 at 12:48:48PM -0400, David Miller wrote: > From: Johan Hovold > Date: Tue, 1 Nov 2016 17:42:25 +0100 > > > On Tue, Nov 01, 2016 at 12:27:11PM -0400, David Miller wrote: > >> From: Johan Hovold > >> Date: Tue, 1 Nov 2016 12:03:35 +0100 >

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread Johan Hovold
On Tue, Nov 01, 2016 at 12:48:48PM -0400, David Miller wrote: > From: Johan Hovold > Date: Tue, 1 Nov 2016 17:42:25 +0100 > > > On Tue, Nov 01, 2016 at 12:27:11PM -0400, David Miller wrote: > >> From: Johan Hovold > >> Date: Tue, 1 Nov 2016 12:03:35 +0100 > >> > >> > diff --git

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread David Miller
From: Johan Hovold Date: Tue, 1 Nov 2016 17:42:25 +0100 > On Tue, Nov 01, 2016 at 12:27:11PM -0400, David Miller wrote: >> From: Johan Hovold >> Date: Tue, 1 Nov 2016 12:03:35 +0100 >> >> > diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c >> >

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread David Miller
From: Johan Hovold Date: Tue, 1 Nov 2016 17:42:25 +0100 > On Tue, Nov 01, 2016 at 12:27:11PM -0400, David Miller wrote: >> From: Johan Hovold >> Date: Tue, 1 Nov 2016 12:03:35 +0100 >> >> > diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c >> > b/drivers/net/ethernet/ti/cpsw-phy-sel.c >> >

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread Johan Hovold
On Tue, Nov 01, 2016 at 12:27:11PM -0400, David Miller wrote: > From: Johan Hovold > Date: Tue, 1 Nov 2016 12:03:35 +0100 > > > diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c > > b/drivers/net/ethernet/ti/cpsw-phy-sel.c > > index 054a8dd23dae..589beb843f56 100644 > > ---

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread Johan Hovold
On Tue, Nov 01, 2016 at 12:27:11PM -0400, David Miller wrote: > From: Johan Hovold > Date: Tue, 1 Nov 2016 12:03:35 +0100 > > > diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c > > b/drivers/net/ethernet/ti/cpsw-phy-sel.c > > index 054a8dd23dae..589beb843f56 100644 > > ---

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread David Miller
From: Johan Hovold Date: Tue, 1 Nov 2016 12:03:35 +0100 > diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c > b/drivers/net/ethernet/ti/cpsw-phy-sel.c > index 054a8dd23dae..589beb843f56 100644 > --- a/drivers/net/ethernet/ti/cpsw-phy-sel.c > +++

Re: [PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread David Miller
From: Johan Hovold Date: Tue, 1 Nov 2016 12:03:35 +0100 > diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c > b/drivers/net/ethernet/ti/cpsw-phy-sel.c > index 054a8dd23dae..589beb843f56 100644 > --- a/drivers/net/ethernet/ti/cpsw-phy-sel.c > +++ b/drivers/net/ethernet/ti/cpsw-phy-sel.c > @@

[PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread Johan Hovold
Make sure to drop the references taken by of_get_child_by_name() and bus_find_device() before returning from cpsw_phy_sel(). Note that there is no guarantee that the devres-managed struct cpsw_phy_sel_priv will continue to be valid until this function returns regardless of this change. Fixes:

[PATCH net 2/4] net: ethernet: ti: cpsw: fix device and of_node leaks

2016-11-01 Thread Johan Hovold
Make sure to drop the references taken by of_get_child_by_name() and bus_find_device() before returning from cpsw_phy_sel(). Note that there is no guarantee that the devres-managed struct cpsw_phy_sel_priv will continue to be valid until this function returns regardless of this change. Fixes: