RE: [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init

From: Fugang Duan
Date: Sun Mar 06 2016 - 11:10:31 EST


From: nick <xerofoify@xxxxxxxxx> Sent: Sunday, March 06, 2016 11:50 AM
> To: Fugang Duan <fugang.duan@xxxxxxx>; davem@xxxxxxxxxxxxx
> Cc: b38611@xxxxxxxxxxxxx; andrew@xxxxxxx; fabio.estevam@xxxxxxxxxxxxx;
> l.stach@xxxxxxxxxxxxxx; rmk+kernel@xxxxxxxxxxxxxxxx; tremyfr@xxxxxxxxx;
> johannes@xxxxxxxxxxxxxxxx; u.kleine-koenig@xxxxxxxxxxxxxx;
> haokexin@xxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> 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@xxxxxxxxx> Sent: Saturday, March 05,
> > 2016 4:00 AM
> >> To: davem@xxxxxxxxxxxxx
> >> Cc: b38611@xxxxxxxxxxxxx; andrew@xxxxxxx;
> >> fabio.estevam@xxxxxxxxxxxxx; l.stach@xxxxxxxxxxxxxx;
> >> rmk+kernel@xxxxxxxxxxxxxxxx; tremyfr@xxxxxxxxx;
> >> johannes@xxxxxxxxxxxxxxxx; u.kleine-koenig@xxxxxxxxxxxxxx;
> >> haokexin@xxxxxxxxx; netdev@xxxxxxxxxxxxxxx;
> >> linux-kernel@xxxxxxxxxxxxxxx
> >> 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@xxxxxxxxx>
> >> ---
> >> 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@xxxxxxx>
> >
> 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