From patchwork Mon Nov 23 12:19:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 331255 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 13B8FC64EBC for ; Mon, 23 Nov 2020 12:43:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B508A208DB for ; Mon, 23 Nov 2020 12:43:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xZvkdbdF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733004AbgKWMm6 (ORCPT ); Mon, 23 Nov 2020 07:42:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:55942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732998AbgKWMm5 (ORCPT ); Mon, 23 Nov 2020 07:42:57 -0500 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 28D772076E; Mon, 23 Nov 2020 12:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135377; bh=KCMwQ8ms3+fccT4L3vRK+OEf2EEAZReWYJ/yKv6uKkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xZvkdbdF47CoKwbdbg5NBPRqBsjMKEJTAG7d8/8qhRjDy7rwW7XjnIOSzMna2eqmC D7eoE0hrr1zEGI4YUxqwoHfWjzegLtfK/38CBcIkfvxXPnwe4wiCVfHZK6Y2t30KC1 a7dSLX2CTcfV9qiznoCf1gXFbJXj22BzB+PKhEL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Bartosz Golaszewski , Jakub Kicinski Subject: [PATCH 5.9 016/252] net: ethernet: mtk-star-emac: fix error return code in mtk_star_enable() Date: Mon, 23 Nov 2020 13:19:26 +0100 Message-Id: <20201123121836.375444396@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121835.580259631@linuxfoundation.org> References: <20201123121835.580259631@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhang Changzhong [ Upstream commit baee1991fad928d6c8dd5be3197ecb413c420c97 ] 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 Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/1605180879-2573-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mediatek/mtk_star_emac.c | 1 + 1 file changed, 1 insertion(+) --- 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_de 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; }