Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319581pxb; Mon, 20 Sep 2021 18:42:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsbqIKOxtJlgTTB5cwsBkYf3FFuG44KvEZpyZDmIM+J9SjzMk+cEENNUiMcQghwZx3MejO X-Received: by 2002:a05:6638:204c:: with SMTP id t12mr21718998jaj.9.1632188570246; Mon, 20 Sep 2021 18:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188570; cv=none; d=google.com; s=arc-20160816; b=ruedE7LoFGq11NiqpAfyC9JcCjo6sHYzIetNkk1aq6LCx2BxDPUwkwQMpABQJbJwBT 1KCfEqB1kYwCQmrPfiSdgFR2UUL6nlbo9U1NKQSHOzmdS4FxaY63A+i5uC880g+NlcNb y0k9XrVwEcePY7/O4XEnCrRxZabvEbhkGGvAVaKZKRjT8Yw9VWuz/9oo9MrnoCkqR5ah Ex2RBNImciRZuDE76hzhtvnWD+k4+3vPJs3cnIbuoBi5ebqr59CjTm/Eo2dkyz3YKI0r 3o2/QiRwegE8yTdU0PCw71G9xflhFbj58GzFu894PIai68CNgD5UwhGHLUbInAB+eMUF BuNQ== 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=EZJUn2L0YipT71AtZn3Rmmrt7kz5ZfqX4r+zISd3+8E=; b=wapV/ke+SRFfu7qoGqBZ98JVT7Fd5jVmMIeaZUXCTMRCqt1IUa+gXxwdk/XextJWda NET0+WgFfHNIBT8+mVZ0cMhoskhhKWlUapNWclVbyKV6F0IRlJWdZuznV0JMYHiYbANC cAwcKJI4xSS7BkN3oNlFo5X9S+WocdoLUGpLeatiJXhG6Rv7bD1VTN8KGD++gI9hzBGW oxne+56Y8QHiCJ/8VnFuUZyNnD3jqskt34/84H27ymDdfncFwEED3RSA2uhZHrMi5E0C yy8IekeUATcWtn5vnOOgBg75u1eTGaTmyWxx4xCcmPv5TZxFqLu776dsYa6BWwtlxjKj 4H4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SyZpm8SL; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si2553036ioz.73.2021.09.20.18.42.39; Mon, 20 Sep 2021 18:42:50 -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=@linuxfoundation.org header.s=korg header.b=SyZpm8SL; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244353AbhITQvj (ORCPT + 99 others); Mon, 20 Sep 2021 12:51:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:36476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242998AbhITQsh (ORCPT ); Mon, 20 Sep 2021 12:48:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 002A561213; Mon, 20 Sep 2021 16:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156430; bh=IAJzPJm6psF2GjI1dEIJkyQ59WOL9V751RVZDVdIXwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SyZpm8SLhTnaJB16ZUZ1xKXvK6pb/RU6iIO9Ctsr1hgTcvRulU9fRE8JdRZiabhml nrz2COd4TjGhe2bdPl5Nh+t7c9rtzNIISSEDuzBgfudDfMG20Dfsz1nd3GglxwjXM0 INRQB0hmAgw7yF1NMAev4Hl/c3EGDtky1BMY5zhI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Sergey Shtylyov , Sasha Levin Subject: [PATCH 4.4 054/133] usb: host: ohci-tmio: add IRQ check Date: Mon, 20 Sep 2021 18:42:12 +0200 Message-Id: <20210920163914.415924888@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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: Sergey Shtylyov [ Upstream commit 4ac5132e8a4300637a2da8f5d6bc7650db735b8a ] The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to usb_add_hcd() (which takes *unsigned* IRQ #), causing request_irq() that it calls to fail with -EINVAL, overriding an original error code. Stop calling usb_add_hcd() with the invalid IRQ #s. Fixes: 78c73414f4f6 ("USB: ohci: add support for tmio-ohci cell") Acked-by: Alan Stern Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/402e1a45-a0a4-0e08-566a-7ca1331506b1@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ohci-tmio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c index cfcfadfc94fc..9c9e97294c18 100644 --- a/drivers/usb/host/ohci-tmio.c +++ b/drivers/usb/host/ohci-tmio.c @@ -202,6 +202,9 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) if (!cell) return -EINVAL; + if (irq < 0) + return irq; + hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev)); if (!hcd) { ret = -ENOMEM; -- 2.30.2