Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746AbcCFQK1 (ORCPT ); Sun, 6 Mar 2016 11:10:27 -0500 Received: from mail-db5eur01on0073.outbound.protection.outlook.com ([104.47.2.73]:9216 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751407AbcCFQKS (ORCPT ); Sun, 6 Mar 2016 11:10:18 -0500 From: Fugang Duan To: nick , "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 Thread-Topic: [PATCH RESEND] net:fec:Fix error checking in the function fec_enet_init Thread-Index: AQHRdlCAN78MHaMffkSxhGMRCcWvmZ9LiWgAgABAXQCAAM6KcA== Date: Sun, 6 Mar 2016 16:10:14 +0000 Message-ID: References: <1457121614-9360-1-git-send-email-xerofoify@gmail.com> <56DBA8D0.5090906@gmail.com> In-Reply-To: <56DBA8D0.5090906@gmail.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [139.227.81.99] x-ms-office365-filtering-correlation-id: 0a392c55-ff64-48bd-db6e-08d345d9cdca x-microsoft-exchange-diagnostics: 1;VI1PR0401MB1854;5:NLo8HF3UzmBE1D1w36y0yex1lVGRatGFE9JEih4XFDx5tIX1N5ndtV0kNKl7n6erY5LkXOGa262obVu/XhNM3zRcd1W7ShR+24ZyvRei38bC/9szSiBRj/cLrjazdO0GX4ZDYBrbaQJhRnmAMB+Gjw==;24:iT2oL9pyM8N7LkllXR+4cPJdZTZ+CDRhPTSNdjfcQ+4TNot2Hn+V5a6gR3Eksnx7XZSjX6/BOKiMFmEtrdxAfFzJ0LWKkCGZV86YcOeHVIc= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB1854; x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:VI1PR0401MB1854;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB1854; x-forefront-prvs: 087396016C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377424004)(377454003)(24454002)(3846002)(6116002)(102836003)(92566002)(77096005)(10400500002)(19580395003)(1096002)(189998001)(1220700001)(19580405001)(81166005)(2900100001)(2950100001)(87936001)(76176999)(54356999)(586003)(106116001)(86362001)(50986999)(5001770100001)(5008740100001)(122556002)(3280700002)(76576001)(33656002)(66066001)(5002640100001)(2906002)(4326007)(2501003)(5003600100002)(3900700001)(40100003)(3660700001)(74316001)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB1854;H:VI1PR0401MB1855.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2016 16:10:15.0496 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB1854 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u26GAVnw009216 Content-Length: 2639 Lines: 76 From: nick Sent: Sunday, March 06, 2016 11:50 AM > To: Fugang Duan ; 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 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 > >> --- > >> 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, > 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