Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1844006pxb; Mon, 13 Sep 2021 06:47:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeZztzc16W/BpT291LaoNztcM6nR0Qan8C/ofbKSTs4CMtMhbCoWH0/c51iuY/jbvEIXyT X-Received: by 2002:a92:cda4:: with SMTP id g4mr8060359ild.236.1631540827786; Mon, 13 Sep 2021 06:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540827; cv=none; d=google.com; s=arc-20160816; b=UD7TMx+caALkJ/unInROtAuqaNhYQQc8AuTzMjhbqVc7pIH9iiHVj+RvNzfmlnQl1k MOb0I36cBIU/btn+wDuH2rs81eUN2RZTb1kTgZZ1U8vwZHx82ajvnL/6oOz1u9Fa95TY 2ATQVEd9OsXvgWZC2Hhy8pOpxSPya2vQywqdb7vBBlXCibbwfzodStJHWpYcYCLT2aez VdHVP4FTDkt3JJzYOvU7sxt5BhpA5zFFqQF4d4bUN4MrrHyBre6BEjXakE98rZ3b9pzh KnrjVk5de7V1aGnvvhuCBHYZkurGtEKN+RTUUGI3BMn6+XSG0uPdA99oq9swfVXFc4De PLtQ== 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=aV/HDWmBaFB+TN1DOHXG+N6GNI+VLg8NsQevrl+14h8=; b=DAvobocjkRxSn4ubUs2sTbtje9/rmztVwZUoHzGSJpVRYYkyfMyUBPMRRXl1lRJiyW 1rrLNUsJSNnFmhsXA6YfjnZ2jKL/NmQVWnuog1UKHEZndQpGQzGWfkiK4bN9orWyaCja B4s7jKauqw/5EvO9NLTJ/CMULzG4hbJnjd9dMpeX+gRg2G905GWzsU+NoaaKYGxCL2jP NKBWGgCnWHO4ylzrtffa85qrC2UfjA12guo+FOKKiu1NL12JVK9JnmENMMexcydBmC/M CjG9Vxu6sZlCYq7EzEvAb8mYEK7kRvLMUK5StXaP+g93XT1xysoaBAz5OaCb1aVT4Cdr v2DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hvNaXlQC; 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 n38si6810333jaf.72.2021.09.13.06.46.51; Mon, 13 Sep 2021 06:47:07 -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=hvNaXlQC; 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 S243620AbhIMNqn (ORCPT + 99 others); Mon, 13 Sep 2021 09:46:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242938AbhIMNlN (ORCPT ); Mon, 13 Sep 2021 09:41:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C009661284; Mon, 13 Sep 2021 13:29:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539784; bh=oLulRJc2tHhj2i0xsNbP/xF1YZEErCzvRn5Suf+glkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hvNaXlQCLfeXScFW86A+iV7OgvzEMCXCyOvbV/MAKyy2pgWDFQgBGo/1AQi6nVvfb JS2wkX9g4iJmya8Pde7uefF/eUX7UAI+q2yNcIREfdLB5zJDWkN4jIvrMpcdhJniB1 aJBY9hv1MQ6wwguy0oNep1+2zHC82kUyfHdm4kgE= 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 5.10 159/236] usb: host: ohci-tmio: add IRQ check Date: Mon, 13 Sep 2021 15:14:24 +0200 Message-Id: <20210913131105.790321683@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 7f857bad9e95..08ec2ab0d95a 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