Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp529794ybl; Tue, 28 Jan 2020 07:23:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyGp2VvotVXPIXKbPn2sWXE2PtS/61/SV5TqlQZTSgQmW5Zi1vwxOiFFhc03hpmu3QavPG0 X-Received: by 2002:a05:6830:1e95:: with SMTP id n21mr11787366otr.25.1580225000748; Tue, 28 Jan 2020 07:23:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580225000; cv=none; d=google.com; s=arc-20160816; b=oRA8RT3KBFRGavgNKobuqY7rlptxBpdvR/o4gi3mxm7e5kh1rIC7ue2nRI5Z3ucwyL 5P5dNnT6WVoRffCMAm7q5aboGca/KPF/Vo6eICAWOygill4rFNPYKgVJKjhNqbLov2kU Mc+zFLzOlMNrtZCc+U+FSRtA6puJeLdu8RpBkONePqeok2OxVr83GADCuEQrUeQD7yUO RMSYfRbCEb4gpCUV3SefEe47ZisO5Bl0bNVMFzQTWGlosa06oelCcuFSCAvHDabuHZS0 WFIFPwwglc28aMTu/5nu97DUiRccl+HT9Yzl33g0+K07zrH/2+frMT6ZVdkrc06Muvjx vbCQ== 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=XJDBbIz6G51vxffnhQRUv8MmUqbj+5psJJMdsDytys8=; b=DNRKRTqNN4R19yWCa0NKD7Z5lETWG0ElVIZl4Oc+N0yw1g9g/Zp386pGE+Lk+3dUEU FKhC+S4dN5IZUmcvVpNrrarrHY8Tre4AHVw9jwgBG9Woq44lDZRi41s5xxBIxSHW4tLK VYDpkJKiQDX83I5YZ+x9lslc+LlNC64dEtjkfSu9+giaFrvhrgBPyWrLwgg9+aJFyCyh /M1jWd/lEpdm9nCZ33AVv4NX3EutsFVES+y+gDynTzbMjErUTt2F1PKgVCmaUdvWzDYR 7O82BGy+yj0l6HeulotutSM7ulpblU408X9DKJaTEmGI6rXGvi1c7HEITX9zUnjZeU0B 7bAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X44YEhg5; 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 e7si4285488otp.260.2020.01.28.07.23.02; Tue, 28 Jan 2020 07:23:20 -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=X44YEhg5; 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 S1731470AbgA1OXM (ORCPT + 99 others); Tue, 28 Jan 2020 09:23:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:49182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731946AbgA1OXJ (ORCPT ); Tue, 28 Jan 2020 09:23:09 -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 E9B6221739; Tue, 28 Jan 2020 14:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221388; bh=ZKlPAfO3zRjg3UAkTcvMoEsUrSwlOG/1XdwucKB2Sb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X44YEhg5MV5GKdRBSWK+3XrC7yqGP1/j6D3PUX7EkR1OWamA7Co006GMmvHmwthsb hn/YSx421zPN5Zd7N3QSEp3X9ofZIOHPuDP3eQ8rW0boNb/JcFSRKjAmbvogjXkpaT PBjHuCM05lpSy0it88m/pqHsHOwcQQEyzb/3LR+M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Martin Blumenstingl , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 205/271] net: stmmac: dwmac-meson8b: Fix signedness bug in probe Date: Tue, 28 Jan 2020 15:05:54 +0100 Message-Id: <20200128135907.815677243@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 f10210517a2f37feea2edf85eb34c98977265c16 ] The "dwmac->phy_mode" is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered. Fixes: 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC") Signed-off-by: Dan Carpenter Reviewed-by: Martin Blumenstingl Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c index f356a44bcb811..6704d3e0392dc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -280,7 +280,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) dwmac->pdev = pdev; dwmac->phy_mode = of_get_phy_mode(pdev->dev.of_node); - if (dwmac->phy_mode < 0) { + if ((int)dwmac->phy_mode < 0) { dev_err(&pdev->dev, "missing phy-mode property\n"); ret = -EINVAL; goto err_remove_config_dt; -- 2.20.1