Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2634973pxa; Mon, 17 Aug 2020 15:03:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyIpq734A/Ss9t42AN3JTRDKT7dLITGEQL6B4gZbhasj38HfEIl7T7dP+q+waP5Pj1nA9m X-Received: by 2002:a17:906:bb0e:: with SMTP id jz14mr17970870ejb.525.1597701812644; Mon, 17 Aug 2020 15:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597701812; cv=none; d=google.com; s=arc-20160816; b=bRj+WTphObvQJ2JGl1qdogg1ixWpOnUABwKnS7hBK/eW3CRsUOSfaYGRoyKMSpS1Y8 rXkn5bw7gjAL69r6PPz3Q7nzIrox8JYM7K6NJyfuCJL0F/P/IT9gBwu6nF55vDUoSafc Aiz2Oiw5JKqd22mbb83L47rFytsHoph/h8kE36mjHqgdEsiqjfwZLGXTNAWvth0jH/t7 v+BdJRD2cfX/IdDRj3skW5+Po7+XAFCqE3c51hQX44gIBCLo7sLID29JbpdJ078pz1+1 FHJ+M0b1VXWd5xTLEouEOzZAYJxdnaoO4d3aGRhNDL/Q5+f7lN4IFrqnHl3VYCVP8zax uOhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5oU+nKSvVCHqHXjFge4NNyLR9JvCTccsZf9yy/3Iq9Q=; b=NrEQ5tE6Doo/hS4/3gAgsTGwWPlDUxHZxwUN3rJf/es236eZPZYlQuORsdPywGnpM3 Uctu1rTMHVhVTZEljajJNc8UQKldUr+sCvj0FAmLd/BUUYHgpeoaslPDIJQDhI6JtTew JxpFTWNZVKuWQmItBBAO2u5CckIj/WvuL54QosbcJUCdf6hoTgbR1f91rmkcqV6Ww/sl 9Tq+VKSMW0LLjQ0v2tuYaih3Brzg3FixlS4qDbxIOHyP+SOAN9lNmmRoWamHvqvgy64s Wdl4c1HL6vlt5HlAU7z5Z2iaTGl0W5AolLa6WTjhjlwsEqRvcvCUHGo1dAPWiLmQIuG4 0NDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1pXh1iMh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx14si12194020ejb.99.2020.08.17.15.03.08; Mon, 17 Aug 2020 15:03:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1pXh1iMh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387536AbgHQPmY (ORCPT + 99 others); Mon, 17 Aug 2020 11:42:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:42434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbgHQPfe (ORCPT ); Mon, 17 Aug 2020 11:35:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 3D6982173E; Mon, 17 Aug 2020 15:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678533; bh=7eBUO9yRTxRtWqOM8/7Dm8BPgRXn/w2CD3hOKUBtd/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1pXh1iMhj2CjTEWi54eLGNZnZLPe1uihW2sionIPJh6blgQ09TWEZN245vIEkX+cY nf/ZqwIFV/KmAWMV4BbCsWjRCiEjTBIIq4KB4Ebka07K1jMFXYoqHnukdMnWrT/b/S JWkqV2/3yJQ7FacujB/AO1o5kJ38z+fwHjiLxLAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YueHaibing , "David S. Miller" , Sasha Levin Subject: [PATCH 5.8 368/464] dpaa2-eth: Fix passing zero to PTR_ERR warning Date: Mon, 17 Aug 2020 17:15:21 +0200 Message-Id: <20200817143851.400030695@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YueHaibing [ Upstream commit 02afa9c66bb954c6959877c70d9e128dcf0adce7 ] Fix smatch warning: drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c:2419 alloc_channel() warn: passing zero to 'ERR_PTR' setup_dpcon() should return ERR_PTR(err) instead of zero in error handling case. Fixes: d7f5a9d89a55 ("dpaa2-eth: defer probe on object allocate") Signed-off-by: YueHaibing Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 89c43401f2889..a4b2b18009c1d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -2207,7 +2207,7 @@ static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv) free: fsl_mc_object_free(dpcon); - return NULL; + return ERR_PTR(err); } static void free_dpcon(struct dpaa2_eth_priv *priv, @@ -2231,8 +2231,8 @@ alloc_channel(struct dpaa2_eth_priv *priv) return NULL; channel->dpcon = setup_dpcon(priv); - if (IS_ERR_OR_NULL(channel->dpcon)) { - err = PTR_ERR_OR_ZERO(channel->dpcon); + if (IS_ERR(channel->dpcon)) { + err = PTR_ERR(channel->dpcon); goto err_setup; } -- 2.25.1