From patchwork Mon Apr 15 08:04:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 2444191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id DFDCB3FD8C for ; Mon, 15 Apr 2013 08:04:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1URePE-0007wB-AL; Mon, 15 Apr 2013 08:04:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1URePC-0003gb-3a; Mon, 15 Apr 2013 08:04:50 +0000 Received: from eusmtp01.atmel.com ([212.144.249.243]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UReP7-0003g9-Gr for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2013 08:04:48 +0000 Received: from tenerife.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.2.342.3; Mon, 15 Apr 2013 10:04:33 +0200 From: Nicolas Ferre To: "David S. Miller" , Subject: [PATCH] net/macb: fix error return code in macb_probe() Date: Mon, 15 Apr 2013 10:04:33 +0200 Message-ID: <1366013073-22934-1-git-send-email-nicolas.ferre@atmel.com> X-Mailer: git-send-email 1.8.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130415_040445_707655_FA78FEBD X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Nicolas Ferre , yongjun_wei@trendmicro.com.cn, Jean-Christophe PLAGNIOL-VILLARD , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Original-idea-by: Signed-off-by: Nicolas Ferre --- Hi, This fix was written originally for at91_ether.c and I found it interesting to adapt it to macb. Thanks to Wei Yongjun for finding it. Best regards, drivers/net/ethernet/cadence/macb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 7fd0e3e..6be513d 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -1602,9 +1602,9 @@ static int __init macb_probe(struct platform_device *pdev) goto err_out_free_irq; } - if (macb_mii_init(bp) != 0) { + err = macb_mii_init(bp); + if (err) goto err_out_unregister_netdev; - } platform_set_drvdata(pdev, dev);