Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp274798pxb; Thu, 12 Nov 2020 03:37:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJymtPCqVHMbfN109+mcPn2232t03w7UO+BVU4Rcad11Lfwb/wHYLaKcomWUi0ePfS7544oM X-Received: by 2002:a17:906:9459:: with SMTP id z25mr30616767ejx.88.1605181051554; Thu, 12 Nov 2020 03:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605181051; cv=none; d=google.com; s=arc-20160816; b=dg/7l/QL9GutHdXMmHXWpC0fiTuGPsw/+fxEpDItI3nFUCHBqlRWH98Nz6bJ3q6yNf fvPTXIOoHh0HVvv2DzZ9RdVVWpUbVJ+UzCxYWhtQ8Yz005HHNO+MV7ujNv6L8WqXOIGQ y70XpKUHtw9SolwZnub7/43bI3IgSaDjHOIoXuf5S1Lrc+PrqgLIrlvsu5FEcb5lBbA1 urrpZ+ACHktNDe1XusJ4VVa8vgH3xK3MrJx20eLsjqksTuezI1nOLI0lxUn6Qyg+bqI3 kZqioIleRDJP/HdbBq2NmDfs3bVhYJPt0Rs2cMZcrfKojEHdz+HuyyJIYNlQw2JkWvha TnsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=KROqyjMxGM/OWw8U6oKBpbzAXVOr29Tpt8kwbu5uvuk=; b=ZnAo1TvkOXQLLE7zngo23fsqLL+bTDFRhkkLA+UGx7/DZaOyFalxCp1h5MXczy4PEg l97TcMA1HNU58WwTipv0UMbuYgybBXa6EEr1fYXjAmlobGX8QR0U/FVZ6unoPBEevsEf IBPOhZL5XdehYmOMSz2TzsmWQw56yhFQSucmvUQLr/y4GGEZMBIjQ4HfRIGxSXGHL4uQ H8JP/FeOaRzC+xkpaZt3O+w+JTY+8TzfIhEem90CNv+r7sQuH30vVM1NEeo+UXduEmms 08EYWhqNmeQzWkJ5gZ/xdmqXoFvKRG83cJ/dgSQ49uKBjYE7g+1LEUvTH9XBR7RKHRJL c6DQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r27si3303033ejc.681.2020.11.12.03.37.09; Thu, 12 Nov 2020 03:37:31 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727920AbgKLLdQ (ORCPT + 99 others); Thu, 12 Nov 2020 06:33:16 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8074 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728158AbgKLLc6 (ORCPT ); Thu, 12 Nov 2020 06:32:58 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CWzwq5dG2zLnGM; Thu, 12 Nov 2020 19:32:43 +0800 (CST) Received: from compute.localdomain (10.175.112.70) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 12 Nov 2020 19:32:52 +0800 From: Zhang Changzhong To: , , , , , , , CC: , Subject: [PATCH net] net: ethernet: mtk-star-emac: fix error return code in mtk_star_enable() Date: Thu, 12 Nov 2020 19:34:39 +0800 Message-ID: <1605180879-2573-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/mediatek/mtk_star_emac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c index 1325055..2ebacb6 100644 --- a/drivers/net/ethernet/mediatek/mtk_star_emac.c +++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c @@ -966,6 +966,7 @@ static int mtk_star_enable(struct net_device *ndev) mtk_star_adjust_link, 0, priv->phy_intf); if (!priv->phydev) { netdev_err(ndev, "failed to connect to PHY\n"); + ret = -ENODEV; goto err_free_irq; } -- 2.9.5