From patchwork Tue Sep 29 10:59:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B69ACC4741F for ; Tue, 29 Sep 2020 12:00:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7200E206DB for ; Tue, 29 Sep 2020 12:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380844; bh=/+pliRggyOjEy8m8uK+MrMptQUHltTkK+F/HawNYwaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RFY4AJ0r5hUlnHorQSsSwNGW+l+Pcvua+Gc1uyXmTUGCLFvGAPJlErPPgdBuegIaP KCYaLs1Y19sr9MBQ6jJdgjACKVeWyAJEUMi9OVK14MA77Rf/YR62Bcjmk2OyH7Go2F dMKLffCdj7Rcn+2RPp0OkKTP7BnPZw09Eyp6Q3Wg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730216AbgI2Lkw (ORCPT ); Tue, 29 Sep 2020 07:40:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:36572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730556AbgI2Lkm (ORCPT ); Tue, 29 Sep 2020 07:40:42 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B08A21941; Tue, 29 Sep 2020 11:40:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379620; bh=/+pliRggyOjEy8m8uK+MrMptQUHltTkK+F/HawNYwaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Psq5Z5mSlxRA/otudHeJtIQ9nRUU/dInMw5LkMKyYQSalaUzh5C3jmnrw58JU11o1 AtPD1essE61UlkunFHXzi9fHogecg13fe/vuPAjwLWoXUzVgZp7BS2dJdSReWJxIxi zue42qSRR59i7eZBDmEJJDX5iXHLM/+69AmngwT8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Yongjun , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 244/388] dpaa2-eth: fix error return code in setup_dpni() Date: Tue, 29 Sep 2020 12:59:35 +0200 Message-Id: <20200929110022.292450723@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wei Yongjun [ Upstream commit 97fff7c8de1e54e5326dfeb66085796864bceb64 ] Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 7a248cc1055a3..7af7cc7c8669a 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -2654,8 +2654,10 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) priv->cls_rules = devm_kzalloc(dev, sizeof(struct dpaa2_eth_cls_rule) * dpaa2_eth_fs_count(priv), GFP_KERNEL); - if (!priv->cls_rules) + if (!priv->cls_rules) { + err = -ENOMEM; goto close; + } return 0;