Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874460pxk; Thu, 17 Sep 2020 19:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG95xRFfZhrBybPQ44U2vR592wQC6NKjNi/fAiT4aYu8Wq2qQ0hHlxPpJ9SHVLU+wfio70 X-Received: by 2002:a17:906:158a:: with SMTP id k10mr33001671ejd.174.1600397946413; Thu, 17 Sep 2020 19:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397946; cv=none; d=google.com; s=arc-20160816; b=Tosr4hgggmzm+gaZtyiFDfRvUFyl7mCNe1P+vvVw8MNyWPKV7HKTcFLkBISASMnzg6 QcqYqvbr5p6jYazXZ2f4hZnllCkAIs23ywv98BP4Em02mQ2exQToErqgcCZqrxJr48QL 4rNohq6X2iOIw1xrclX3iIKEUYCSPyaaTRYpoxPepCdv6OcJ1gDJ5dR1Wtv9jIJQoRXd Dd7NXWR1FcYZrmudAZFsR6MtArtR1MXChdpPM+jIj6YCZjZjUkvgF5RNKVxxCdvZ3lvA A1/rop0/o0XK1J981BqJYbFViaVnhY6qaEZhEYnCwnNmgMv5YvQY0qPeeOAKTnZMPLdn wjdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O7Lan4cistoxO4Krsiw7qF/rpYphpKAulC7DBk1cBwA=; b=TzQiEPNmxaqbaaOnzVhybrgsQHL67mWG4BmJfnCowYR/ScRdCMCjuoTiRr8RhgvVEm smkloJmWXRxVEs4+TYWTL9QouY/qf0boL5cew0Ex2HKvOhyAf0nm5vojwp10lHFBP+Mm +dGmrtaijTVy4QW4dOhG5Rc0RFq+EnwQwJ+YLbx0P5IZAS797j6dvN23hidS3LauXP2D 42dZwmig0WBrX1YN3mDCayNudCqxtXgWIpaK/IH53bxZ8nnvayhcfaPxwTSBHSKcMHCI fdMLUQgDOt76VALNh/4FuWCwisBmLJZnFsc+yxpBhU7Wz8BqxJAtVM17u7kVuhrJqwvN DBuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NOsLTJrg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si1131346eds.432.2020.09.17.19.58.42; Thu, 17 Sep 2020 19:59:06 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=NOsLTJrg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729527AbgIRC43 (ORCPT + 99 others); Thu, 17 Sep 2020 22:56:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:57118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbgIRCHF (ORCPT ); Thu, 17 Sep 2020 22:07:05 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1868423976; Fri, 18 Sep 2020 02:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394805; bh=bIp/ihUqsJ5r/9HbKQr3t1tGG+Kr4sjrJEFKzdV181Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NOsLTJrgqT/U/UJUjVazxrVzsYtCp2r07mtAJL2yPCLpLmYuzpgdG8GJV+n308Bmq n27U46Iw04NGoZZzrFOCl/oAks2brawbRFoVGzd2cM7G1dlt4Jf83lK4uQavUi9Ts+ esNkNAKKk7L6c9B1tyqaKYNEaN2sQ3FnZcx8zIZU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Colin Ian King , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 274/330] USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int Date: Thu, 17 Sep 2020 22:00:14 -0400 Message-Id: <20200918020110.2063155-274-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit a7f40c233a6b0540d28743267560df9cfb571ca9 ] The comparison of hcd->irq to less than zero for an error check will never be true because hcd->irq is an unsigned int. Fix this by assigning the int retval to the return of platform_get_irq and checking this for the -ve error condition and assigning hcd->irq to retval. Addresses-Coverity: ("Unsigned compared against 0") Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20200515165453.104028-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ehci-mv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 15b2e8910e9b7..b6f196f5e252e 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -156,11 +156,10 @@ static int mv_ehci_probe(struct platform_device *pdev) hcd->rsrc_len = resource_size(r); hcd->regs = ehci_mv->op_regs; - hcd->irq = platform_get_irq(pdev, 0); - if (hcd->irq < 0) { - retval = hcd->irq; + retval = platform_get_irq(pdev, 0); + if (retval < 0) goto err_disable_clk; - } + hcd->irq = retval; ehci = hcd_to_ehci(hcd); ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs; -- 2.25.1