Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319569pxb; Mon, 20 Sep 2021 18:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMFQypcXU3aza8iDlRWEfIgDc1N0mvnQY9MLdLwIqHauQ7fcq44Nm+dGH+TTF29g103a05 X-Received: by 2002:a5d:94c4:: with SMTP id y4mr9076483ior.131.1632188568441; Mon, 20 Sep 2021 18:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188568; cv=none; d=google.com; s=arc-20160816; b=s+HN753D8v5aGQW2EzOsspL6LBRAZF84pBth4acB7QL6ERzHBcCgK0XdbjjT3X04ld V5pWLsFRaYzhxmbY0NHBVdW4O8C06vUmd8pdzJX/VX9v64TUCFJ3hJLH5th7v+vLeoPK 0/dUyDh7pNpkN2rP2VBu6iWAzBDNRUzZCqfdIy2csiYuOq06/lSQMH0FD3saieMTS7QL K4c/Py6usW7DfIcB32Nqd1L0LQ8ji9cFOBB5OY9WF0SLMA0aK8c9hgLNSBJwE0OeLJDE E5bDWfH0z77fNxFva6Y973Fg1CUvujNYq5KKzqkvMDyi5cCGupbfqsGXlIBKVMs2doXr pg1w== 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=KdCfCw1hXwmOKbkfvSvVp7ZDwr/B0bDQ0m3wWulkoDA=; b=yXxZB0EmxUkj7WxQj660kpK6BfWFcDX72je5HmC8EKj/ub0YE0+9juavtZLgDv2RZ+ FQN1+bZZz2HnNqxVCzsBUAQQ2LiLRurijnMQLC3blSqlOEgpOZs5OVmyquvvxRLZ1hcB RLA9T6oT3eze15yp5ZCVTlX+x55/jOgxmudDAb5K2uuuP/14OGSknpMwQ2+9D3hyMzml 8AOFwLk7RNYaoc4jSUTJjV/lRrgsR6IVQWvxohDa4ODKpV6/A9dKXTt7vVHbzaXgviZf peFjRh+tghyJ4BECYc07e9sjdLezR+Ih/eaWgtKUr53jZSEIvfmbvn1oNWeB5ApgtD8P hyMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s5y53aG3; 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 c20si5348151ilu.11.2021.09.20.18.42.37; Mon, 20 Sep 2021 18:42:48 -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=s5y53aG3; 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 S244092AbhITQvc (ORCPT + 99 others); Mon, 20 Sep 2021 12:51:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:37262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243348AbhITQsd (ORCPT ); Mon, 20 Sep 2021 12:48:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 981736127A; Mon, 20 Sep 2021 16:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156426; bh=aLabv6Op8VuUT0oGrhKsfH/ZuAca9Fk0IWafQY9cbGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5y53aG3RHLH259vm2H2pp+CtZHknQwqc8LRKVj3ntMq/OtS9kdiHGsF9teQIWc71 F+ls3NBsaefv7j4ohhaPuvTA/4SdW/hlmbQZhWDwWZ/gsNXxXVThHXYwZkOQ9aGnnZ uf36h+QqwBooWYD21QIBg20kMz0sFfxui2YJs49Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , Sergey Shtylyov , Sasha Levin Subject: [PATCH 4.4 052/133] usb: phy: twl6030: add IRQ checks Date: Mon, 20 Sep 2021 18:42:10 +0200 Message-Id: <20210920163914.348688178@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 0881e22c06e66af0b64773c91c8868ead3d01aa1 ] The driver neglects to check the result of platform_get_irq()'s calls and blithely passes the negative error codes to request_threaded_irq() (which takes *unsigned* IRQ #), causing them both to fail with -EINVAL, overriding an original error code. Stop calling request_threaded_irq() with the invalid IRQ #s. Fixes: c33fad0c3748 ("usb: otg: Adding twl6030-usb transceiver driver for OMAP4430") Acked-by: Felipe Balbi Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/9507f50b-50f1-6dc4-f57c-3ed4e53a1c25@omp.ru Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/phy/phy-twl6030-usb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/phy/phy-twl6030-usb.c b/drivers/usb/phy/phy-twl6030-usb.c index 12741856a75c..220e1a59a871 100644 --- a/drivers/usb/phy/phy-twl6030-usb.c +++ b/drivers/usb/phy/phy-twl6030-usb.c @@ -336,6 +336,11 @@ static int twl6030_usb_probe(struct platform_device *pdev) twl->irq2 = platform_get_irq(pdev, 1); twl->linkstat = OMAP_MUSB_UNKNOWN; + if (twl->irq1 < 0) + return twl->irq1; + if (twl->irq2 < 0) + return twl->irq2; + twl->comparator.set_vbus = twl6030_set_vbus; twl->comparator.start_srp = twl6030_start_srp; -- 2.30.2