From patchwork Fri Jan 24 09:32:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232885 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 CE273C2D0DB for ; Fri, 24 Jan 2020 11:34:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FA4920704 for ; Fri, 24 Jan 2020 11:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865644; bh=+iycbByS+3ZkLddOKrP3B/qJT4XFTohm0XrOP3XxE1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rR8oDU3HheDmj3NHiQQ7blEHgVSB4847YV7IgWqnviqvvlmP7yjZCP6o8o2+jqbrA AHfbf0PiVlycAdeGqFtlGbYUG58gufWGJE7QbeaAumTbxSHJT7XPYfPlbLQN1BuHE9 XHAq+uen6elOTd7UYJuqCatow4pFrjx4UdsvmUSw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388673AbgAXLeD (ORCPT ); Fri, 24 Jan 2020 06:34:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:53830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404672AbgAXLeC (ORCPT ); Fri, 24 Jan 2020 06:34:02 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 26990206D4; Fri, 24 Jan 2020 11:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865641; bh=+iycbByS+3ZkLddOKrP3B/qJT4XFTohm0XrOP3XxE1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mJ0cKweDC85ptF+yf8K67z10FKTpy3HFWC4L96uR2B/mr9DbMepLuCfrOxAt/hR1s nSzD+jpgICQaGmGnkDVcIS4g+9d1S2EWMj1IoBth3h0aE9FaBhQZ/xdX0kBm1Op/2J uIjKZ9b44XVl0SF+Sedj/zCxlp2BXWBuIQtC03UY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Radhey Shyam Pandey , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 581/639] net: axienet: fix a signedness bug in probe Date: Fri, 24 Jan 2020 10:32:31 +0100 Message-Id: <20200124093202.245256577@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter [ Upstream commit 73e211e11be86715d66bd3c9d38b3c34b05fca9a ] The "lp->phy_mode" is an enum but in this context GCC treats it as an unsigned int so the error handling is never triggered. Fixes: ee06b1728b95 ("net: axienet: add support for standard phy-mode binding") Signed-off-by: Dan Carpenter Reviewed-by: Radhey Shyam Pandey Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 28764268a44f8..b093f14eeec39 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1573,7 +1573,7 @@ static int axienet_probe(struct platform_device *pdev) } } else { lp->phy_mode = of_get_phy_mode(pdev->dev.of_node); - if (lp->phy_mode < 0) { + if ((int)lp->phy_mode < 0) { ret = -EINVAL; goto free_netdev; }