Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp481798ybl; Tue, 28 Jan 2020 06:38:15 -0800 (PST) X-Google-Smtp-Source: APXvYqyRy6xIrq2911sPn5YAr4X/SuASORw3f/Ku4JRS7lWJJd0RT4SIMqndK+uhuqBbElNi192Q X-Received: by 2002:aca:f517:: with SMTP id t23mr2867852oih.160.1580222295144; Tue, 28 Jan 2020 06:38:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222295; cv=none; d=google.com; s=arc-20160816; b=ERcKvMTJgfZZFSjMHfa7T67BGsSqBuKjfZGfi/Ck+Mx3LUlX3j6ZQL5N68HskK/9rT sYEtehad8gyBSTZHw615X0ADyuK7rgL+QkgMcnVMQkAdOIFYK59woW/FKDhV9jMj2x9C 12GG5Sk/O0IASvKMy1dkjx80AwgNqoCUtqGgSm14ZguKrEDxIdvzl067b4b7rRVklZRP +UIM/mSOETbnZzJaQskQiaWFiFuHBrxV1neqChYGBrEixYwZh4fZ9jJ8uWCvlZXq+4bQ JCH4k/DzWS0smlAwswRjVgNBxuAbk2gkajFXnxQQs2Lvb+WglYUtMKV68IA+zI73THk0 NZcQ== 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=h038eG/l+8TtGqFro7QuJcQLCLTWsLYoEw9LZFs4MPo=; b=inj0/4t9gYIworSPXv/td2/Lr0kql0vd8oVAUIUNka9lcbpd4A31COd+SfG6Y6yK6H ttSJJ3O+o35k+u67FSLxAnm3EbTqfQGR5UwDDUU2vHi7j8KnnPGQD9ngnWwOBzPEh4j+ jsLxWeS9LbWugEzepjt6OUcGDnlapWkOPIO3H6ZZUqWfxwmxkixOB4Qik7sFCR5U8Mxb P13dRD/l98U7jWAlMmeTHcveznkTt+t1awyzdzq3oaxaD1p6GBf9xICpN+3Lf/OmmgsS 9iuPj5wdKtrN3zczEBOm4ePcoWpURHglF7AqFnfvkVI7HMrFbfT6/PrLHnvkX7rsSGlG FdmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L/TLYwt3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si7132489oth.99.2020.01.28.06.38.03; Tue, 28 Jan 2020 06:38:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L/TLYwt3"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733250AbgA1OfV (ORCPT + 99 others); Tue, 28 Jan 2020 09:35:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:49088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731192AbgA1OXE (ORCPT ); Tue, 28 Jan 2020 09:23:04 -0500 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 F392D24681; Tue, 28 Jan 2020 14:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221383; bh=VfFWYzYApvPLBIHMHdg2/fG56TcV+/zFg71lTUvwlDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L/TLYwt318xq1K4kijXvmfO3DVm1vUtim7n8EKAYtQcHI+qPlhtgbNref4tXXPEhw m8fs5/rCAE3kxI+kOaN5r4q1YePdVOde6S6mg1XobJ/MofqK0AHe2JL4tZQcE2wnNx +SfJI5fP/gCN/KBqtvt1wMf/JgqXvEUtzqFbmIuY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 203/271] net: hisilicon: Fix signedness bug in hix5hd2_dev_probe() Date: Tue, 28 Jan 2020 15:05:52 +0100 Message-Id: <20200128135907.674070948@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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: Dan Carpenter [ Upstream commit 002dfe8085255b7bf1e0758c3d195c5412d35be9 ] The "priv->phy_mode" variable is an enum and in this context GCC will treat it as unsigned to the error handling will never trigger. Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c index e69a6bed31a95..dd24c352b2000 100644 --- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c +++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c @@ -929,7 +929,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev) goto err_free_mdio; priv->phy_mode = of_get_phy_mode(node); - if (priv->phy_mode < 0) { + if ((int)priv->phy_mode < 0) { netdev_err(ndev, "not find phy-mode\n"); ret = -EINVAL; goto err_mdiobus; -- 2.20.1