* RE: [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init [not found] <1457121614-9360-1-git-send-email-xerofoify@gmail.com> @ 2016-03-06 0:00 ` Fugang Duan [not found] ` <56DBA8D0.5090906@gmail.com> 2016-03-06 11:09 ` Uwe Kleine-König 1 sibling, 1 reply; 3+ messages in thread From: Fugang Duan @ 2016-03-06 0:00 UTC (permalink / raw) To: Nicholas Krause, davem Cc: b38611, andrew, fabio.estevam, l.stach, rmk+kernel, tremyfr, johannes, u.kleine-koenig, haokexin, netdev, linux-kernel From: Nicholas Krause <xerofoify@gmail.com> Sent: Saturday, March 05, 2016 4:00 AM > To: davem@davemloft.net > Cc: b38611@freescale.com; andrew@lunn.ch; fabio.estevam@freescale.com; > l.stach@pengutronix.de; rmk+kernel@arm.linux.org.uk; tremyfr@gmail.com; > johannes@sipsolutions.net; u.kleine-koenig@pengutronix.de; > haokexin@gmail.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [PATCH RESEND] net:fec:Fix error checking in the function > fec_enet_init > > This fixes error checking in the function fec_enet_init to properly check if the > internal call to the function fec_enet_alloc_queue fails and if so immediately > return the error code to the caller for it to handle it's own intended error paths. > > Signed-off-by: Nicholas Krause <xerofoify@gmail.com> > --- > drivers/net/ethernet/freescale/fec_main.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/freescale/fec_main.c > b/drivers/net/ethernet/freescale/fec_main.c > index b349e6f..18c625f 100644 > --- a/drivers/net/ethernet/freescale/fec_main.c > +++ b/drivers/net/ethernet/freescale/fec_main.c > @@ -3123,6 +3123,7 @@ static int fec_enet_init(struct net_device *ndev) > dma_addr_t bd_dma; > int bd_size; > unsigned int i; > + int ret; > > #if defined(CONFIG_ARM) > fep->rx_align = 0xf; > @@ -3132,7 +3133,9 @@ static int fec_enet_init(struct net_device *ndev) > fep->tx_align = 0x3; > #endif > > - fec_enet_alloc_queue(ndev); > + ret = fec_enet_alloc_queue(ndev); > + if (ret) > + return ret; > > if (fep->bufdesc_ex) > fep->bufdesc_size = sizeof(struct bufdesc_ex); > -- > 2.1.4 Thanks. Acked-by: Fugang Duan <Fugang.duan@nxp.com> ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <56DBA8D0.5090906@gmail.com>]
* RE: [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init [not found] ` <56DBA8D0.5090906@gmail.com> @ 2016-03-06 16:10 ` Fugang Duan 0 siblings, 0 replies; 3+ messages in thread From: Fugang Duan @ 2016-03-06 16:10 UTC (permalink / raw) To: nick, davem Cc: b38611, andrew, fabio.estevam, l.stach, rmk+kernel, tremyfr, johannes, u.kleine-koenig, haokexin, netdev, linux-kernel From: nick <xerofoify@gmail.com> Sent: Sunday, March 06, 2016 11:50 AM > To: Fugang Duan <fugang.duan@nxp.com>; davem@davemloft.net > Cc: b38611@freescale.com; andrew@lunn.ch; fabio.estevam@freescale.com; > l.stach@pengutronix.de; rmk+kernel@arm.linux.org.uk; tremyfr@gmail.com; > johannes@sipsolutions.net; u.kleine-koenig@pengutronix.de; > haokexin@gmail.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH RESEND] net:fec:Fix error checking in the function > fec_enet_init > > > > On 2016-03-05 07:00 PM, Fugang Duan wrote: > > From: Nicholas Krause <xerofoify@gmail.com> Sent: Saturday, March 05, > > 2016 4:00 AM > >> To: davem@davemloft.net > >> Cc: b38611@freescale.com; andrew@lunn.ch; > >> fabio.estevam@freescale.com; l.stach@pengutronix.de; > >> rmk+kernel@arm.linux.org.uk; tremyfr@gmail.com; > >> johannes@sipsolutions.net; u.kleine-koenig@pengutronix.de; > >> haokexin@gmail.com; netdev@vger.kernel.org; > >> linux-kernel@vger.kernel.org > >> Subject: [PATCH RESEND] net:fec:Fix error checking in the function > >> fec_enet_init > >> > >> This fixes error checking in the function fec_enet_init to properly > >> check if the internal call to the function fec_enet_alloc_queue fails > >> and if so immediately return the error code to the caller for it to handle it's > own intended error paths. > >> > >> Signed-off-by: Nicholas Krause <xerofoify@gmail.com> > >> --- > >> drivers/net/ethernet/freescale/fec_main.c | 5 ++++- > >> 1 file changed, 4 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/net/ethernet/freescale/fec_main.c > >> b/drivers/net/ethernet/freescale/fec_main.c > >> index b349e6f..18c625f 100644 > >> --- a/drivers/net/ethernet/freescale/fec_main.c > >> +++ b/drivers/net/ethernet/freescale/fec_main.c > >> @@ -3123,6 +3123,7 @@ static int fec_enet_init(struct net_device *ndev) > >> dma_addr_t bd_dma; > >> int bd_size; > >> unsigned int i; > >> + int ret; > >> > >> #if defined(CONFIG_ARM) > >> fep->rx_align = 0xf; > >> @@ -3132,7 +3133,9 @@ static int fec_enet_init(struct net_device *ndev) > >> fep->tx_align = 0x3; > >> #endif > >> > >> - fec_enet_alloc_queue(ndev); > >> + ret = fec_enet_alloc_queue(ndev); > >> + if (ret) > >> + return ret; > >> > >> if (fep->bufdesc_ex) > >> fep->bufdesc_size = sizeof(struct bufdesc_ex); > >> -- > >> 2.1.4 > > Thanks. > > > > Acked-by: Fugang Duan <Fugang.duan@nxp.com> > > > Fugang, > I have a few other patches for freescale ethernet drivers lying around. Would > you like me to resend them or are you just taking this one patch? > Cheers, > Nick Hi Nick, Pls resend them, thanks. Regards, Andy ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init [not found] <1457121614-9360-1-git-send-email-xerofoify@gmail.com> 2016-03-06 0:00 ` [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init Fugang Duan @ 2016-03-06 11:09 ` Uwe Kleine-König 1 sibling, 0 replies; 3+ messages in thread From: Uwe Kleine-König @ 2016-03-06 11:09 UTC (permalink / raw) To: Nicholas Krause Cc: davem, B38611, andrew, fabio.estevam, l.stach, rmk+kernel, tremyfr, johannes, haokexin, netdev, linux-kernel Hello Nicholas, On Fri, Mar 04, 2016 at 03:00:14PM -0500, Nicholas Krause wrote: > This fixes error checking in the function fec_enet_init to properly > check if the internal call to the function fec_enet_alloc_queue fails > and if so immediately return the error code to the caller for it to > handle it's own intended error paths. > > Signed-off-by: Nicholas Krause <xerofoify@gmail.com> Looks right. There seem to be some more oportunities for similar patches. E.g. if dmam_alloc_coherent fails the effects of fec_enet_alloc_queue should be undone. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-06 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1457121614-9360-1-git-send-email-xerofoify@gmail.com>
2016-03-06 0:00 ` [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init Fugang Duan
[not found] ` <56DBA8D0.5090906@gmail.com>
2016-03-06 16:10 ` Fugang Duan
2016-03-06 11:09 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®