Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3763229pxk; Tue, 29 Sep 2020 05:48:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDTluTtaO8Dwsj0kdYpHOZ02QMiBUJ89WbiEQXbSJX3WP78fwvCLNc0ZN9tJyja+ooJIlE X-Received: by 2002:aa7:c98d:: with SMTP id c13mr3122636edt.199.1601383711127; Tue, 29 Sep 2020 05:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601383711; cv=none; d=google.com; s=arc-20160816; b=XX62nvAUgfA0OuJt63ZCWLX8kEYsYscKTWkHSA0E6cF76d966mgujapbZEDlwsb2yz 8XH2AjnB7JJuefNmgwdoyjgmMVQUbr7X8qb4cRSerfc/aKC2JJ33yF9N0aRLZ+44XWzA eBcPG/aUHzAlig7+CM8Z4CBwHtA1GvBTtO8z5ysl1/B3P2L+VZ33mZCDFBcCSYTHWOmr J6m+1mgp1ICtU0Hs/oOhLuOmGZTWsDkFhPF+xOiWwO0C8L1uIPJz3hC43OAaqGFgxinP UugPALVbdZUPPiCcRggnjl2Uv4rPY59J3GBakc5rRBW+LWsuBfM62ixtSSumvv2pWST9 nElA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1drE2oEzTrg1qiWFe2CD+o9700YIAVrwniP67XHUE0o=; b=F1tL2ow1iiJot0DuI5eKMgG6z2E4UFKnrqQEIJ7Pp/yXJ42c919g3cDHfkAaV0KAsv uFA30IrjphtN2dXBJ+VGaXHtSVStVlmI4DUjJt+5xX+seQAdtE0MEeyNLG8E5DbRQhM0 UCaI4fN8mmS4Iq+FMzrk5JIuY9w2EwupEC1mqANBCbh7t2fUFV1uarELnsFAyMG6zAOb N9oNq/AD24rJcI1foudg0j2R6uS/NuZiVbKg+KUeGP+l3IJfEg7fA/1kTKWjTTyrd8P2 6zHk9fG5gjUyXx1xinxBmezQ6kG67701viC+veFolm05fU/O34OSiWHSOyGMaFKh0L0P aavA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LDhmUayK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si2620026edy.412.2020.09.29.05.48.08; Tue, 29 Sep 2020 05:48:31 -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=LDhmUayK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387510AbgI2MrO (ORCPT + 99 others); Tue, 29 Sep 2020 08:47:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728810AbgI2LGJ (ORCPT ); Tue, 29 Sep 2020 07:06:09 -0400 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 D384021D7F; Tue, 29 Sep 2020 11:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377568; bh=Qnb7v+IqHLj39Yydb1cSs7Vz5UOoaqF/j5QMD0w0o8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDhmUayKOJxSXswhVCvX9MA/f+78iRg/Z+3yzLLNEC2p26HaFZ4NUdJz0Ob8Ng/2k UqPscCtWw5LbJ9UWf4rfVNUHx7AQ8/N9xT0vXKeHt5REX75VxdNK1H44djtu0Fr87u PBiq5pnQNqcMNaXuPlSNlRGknv8ybM8ZtcXB/Kok= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Sasha Levin Subject: [PATCH 4.4 62/85] USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int Date: Tue, 29 Sep 2020 13:00:29 +0200 Message-Id: <20200929105931.315147158@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 273736e1d33fa..b29610899c9f6 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -196,11 +196,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