From patchwork Thu May 7 12:56:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 469645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id E6DEB14028F; Thu, 7 May 2015 22:56:54 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1YqLMA-0001kO-SL; Thu, 07 May 2015 12:56:50 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1YqLM0-0001hz-1O for kernel-team@lists.ubuntu.com; Thu, 07 May 2015 12:56:40 +0000 Received: from 1.general.ppisati.uk.vpn ([10.172.193.134] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YqLLz-0001xs-UA for kernel-team@lists.ubuntu.com; Thu, 07 May 2015 12:56:40 +0000 From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/6] net: cpsw: Add missing return value Date: Thu, 7 May 2015 14:56:34 +0200 Message-Id: <1431003398-25939-3-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431003398-25939-1-git-send-email-paolo.pisati@canonical.com> References: <1431003398-25939-1-git-send-email-paolo.pisati@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Markus Pargmann BugLink: http://bugs.launchpad.net/bugs/1452628 ret is set 0 at this point, so jumping to that error label would result in a return value of 0. Set ret to -ENOMEM to return a proper error value. Signed-off-by: Markus Pargmann Reviewed-by: Wolfram Sang Signed-off-by: David S. Miller (cherry-picked from 4d507dffe766b8e29f29d17ae8e0611b5638286e upstream) Signed-off-by: Paolo Pisati --- drivers/net/ethernet/ti/cpsw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 7bf6c4e..024c2b9 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1956,6 +1956,7 @@ static int cpsw_probe(struct platform_device *pdev) priv->irq_enabled = true; if (!priv->cpts) { pr_err("error allocating cpts\n"); + ret = -ENOMEM; goto clean_ndev_ret; }