Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1827003pxb; Mon, 13 Sep 2021 06:26:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgsFfkH8gmXjJr/09P52qj29qMRvF5qES0BCh0O3oHhdXqsrlOQDhwKm7k9Mx9fbPMbZwc X-Received: by 2002:a5d:8d06:: with SMTP id p6mr8962686ioj.7.1631539576216; Mon, 13 Sep 2021 06:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539576; cv=none; d=google.com; s=arc-20160816; b=C1NE6zLpdVC4bjOT16TBsS9kt7EfZgExaXkVwEXmARaPinZfqEbfCMjzCFQRtLS/BX 1hDbGB2jLjeZPoj/IL+QP4oUjw5SPshcCHDZ0/wIZaoiN5OvPi99s0FfNaPrYtYV6/Nk vrOmVvf6Z4uRMo2Mqqc3dGEhCO57k7T1+R6Q+6HDLoj4IKzZhyIDYD0HD0O5Vs1MMyPU krWjFzvfgD04iUjUOOmwJajTAuZM3Nlbnl9EdHsNKr1jW1Ovh6SdcjJP+PRmX2HKjtdY 5lEvV7y0HV2KDzEc/pxSkKZ+xWYL9xhI0u+AlZJq+TaCdjwUmHVLo98J1u/lzy/LsW9s P8vw== 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=fv4D4195HrmWHckq9IT8p2Ul3VZ/if8GDRBQL8xI64o=; b=EkXocUyUFCqPcxcTBoy8pF8HVxq+Xx17jlO1Yf6pvHvvJkZgNMW8k8QdljMbxPl0lr x1fNpubmTb9nnN7n5ld1nzZ8rvCdHov708lwuFbAPdPxTIYrwC5hIhIQnrinrZtPHtsb 9pkTsRN5wDpreOJPnXD67hB8yfWXikknt9Qnlno8JEGkhSDcmxxg6cGP7cNcTbgogN7m Q3Lio1xhPW3NCiD47DpTKJsx6voT2H83a17E3pROlRY7o/Zt4nzxCGUwAYI6ngT2q2Rt 100yBYoSBkqQms8/3pgqJf/w/NViGtw8NtwNTU0iOAHywDfGeBZGW/W2nMMF3/msqcIc gWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2pAUjvAN; 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 q74si7702168iod.9.2021.09.13.06.26.03; Mon, 13 Sep 2021 06:26:16 -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=2pAUjvAN; 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 S241823AbhIMNZy (ORCPT + 99 others); Mon, 13 Sep 2021 09:25:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:38100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240500AbhIMNXM (ORCPT ); Mon, 13 Sep 2021 09:23:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C67F6108B; Mon, 13 Sep 2021 13:21:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539283; bh=KiDBhXZ7RdMy0kGtZMgu2PLDtHCRjgXdc9e6YuIvfDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2pAUjvANOaPskZFfOZBDlpzuEsBm5aS00DSr2N9fx48uT4moicT8SEsnvwg3kg9zP 1J6ZSBSdNuBPIb2um766t0YbKURK3zoLDemuADSjg7VePBko9SR9kOtBpZ8swFrfqq QHlt+WKKqr+WM35fhs7gh70G1DM435o8gnFE4yVY= 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.4 093/144] usb: host: ohci-tmio: add IRQ check Date: Mon, 13 Sep 2021 15:14:34 +0200 Message-Id: <20210913131051.058315407@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 fb6f5e9ae5c6..fed43c6dd85c 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