Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2997C433FE for ; Mon, 13 Dec 2021 09:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234442AbhLMJfs (ORCPT ); Mon, 13 Dec 2021 04:35:48 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:59248 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234159AbhLMJeu (ORCPT ); Mon, 13 Dec 2021 04:34:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id DA5A5CE0E63; Mon, 13 Dec 2021 09:34:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89EF4C00446; Mon, 13 Dec 2021 09:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639388087; bh=927BIJLixGI3sCCasW0Z48GPjYIGWlEIXDIWQTg4LH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mKTlsliC2kqUamrnmliwLv8wH28tNbyVlRQk8MoF7mopXfTX4hdlx3L6+cNxocXKV s1ZXl4tyOjxx8ChvsGrFWR/LS7XwB6JLHOTrPSa87yys2AYiT1o5VOtjucYjY/L9Zf v6Ksnv+db4CZzPpbwvZkFB9PZc7M2ybHSbyVSJPg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , "David S. Miller" Subject: [PATCH 4.9 25/42] net: altera: set a couple error code in probe() Date: Mon, 13 Dec 2021 10:30:07 +0100 Message-Id: <20211213092927.395124739@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211213092926.578829548@linuxfoundation.org> References: <20211213092926.578829548@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit badd7857f5c933a3dc34942a2c11d67fdbdc24de upstream. There are two error paths which accidentally return success instead of a negative error code. Fixes: bbd2190ce96d ("Altera TSE: Add main and header file for Altera Ethernet Driver") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/altera/altera_tse_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1361,16 +1361,19 @@ static int altera_tse_probe(struct platf priv->rxdescmem_busaddr = dma_res->start; } else { + ret = -ENODEV; goto err_free_netdev; } - if (!dma_set_mask(priv->device, DMA_BIT_MASK(priv->dmaops->dmamask))) + if (!dma_set_mask(priv->device, DMA_BIT_MASK(priv->dmaops->dmamask))) { dma_set_coherent_mask(priv->device, DMA_BIT_MASK(priv->dmaops->dmamask)); - else if (!dma_set_mask(priv->device, DMA_BIT_MASK(32))) + } else if (!dma_set_mask(priv->device, DMA_BIT_MASK(32))) { dma_set_coherent_mask(priv->device, DMA_BIT_MASK(32)); - else + } else { + ret = -EIO; goto err_free_netdev; + } /* MAC address space */ ret = request_and_map(pdev, "control_port", &control_port,