Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp66727pxb; Mon, 13 Sep 2021 13:06:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo4fVNrNKnJ25kq6H5z1TwFwpNt9d7/9HfUyBZUrMKqHrKe/lzWz2IHzs5fTBr7rjihEJn X-Received: by 2002:a05:6402:88e:: with SMTP id e14mr8517604edy.342.1631563617095; Mon, 13 Sep 2021 13:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563617; cv=none; d=google.com; s=arc-20160816; b=rQ+VQP5OdUgtKZYzfq2IAW8A/ijjSPHQE0LOos/a/DQWw718A59B8Rr9MS6HxB3Htw t0NZ+k/yMSxtawnvxM34WnE5iJKm9L1+a/7Sb7abnsTCEGKh1APEmM5XeO5lEXrfwLuF PSHZqJiV2lLTDSVSJjX4sSgD2oe9harME9HX6z4m8+xuCouEdgTHEZmzfycHcKJ6xen/ Rc1GdAxZQqwMCbnrxFcE4TcPv0GBNKeG4xiUlyIrISHx7bc9NpQUfZfjkmHKfuca7aCw rmEwp40i4UpX8RMLOeQlwrNqnrPU5hZ6EqwGUjiKIXrTSfqeztnX6lUssmm0XtApgL73 Ph0g== 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=Q3wcDtvUUhODqcXqUiMrf26cbGURCZApbLND7jUUnHM=; b=PeNI76ed4B8godQkoEa1OrB9uC7/BG0VqgB5+3NQYys30UNMa7EeAsdbC8dJl2iCzm ztWU3qJILFzDP5nTfk2jvqq1YEjt8PiEehL0Ac2hFmcULaoOFvI9URnZmrxhFbDP2tut 5bzoa5V4GOX/CNx4EcryQUkeu55K5t8Y6vIPEK6vtrskeuIfUUXUYofCMdrfVlxjgCDM 5zXvWZaYhKyF3ixgyMxu0EV1QjJq4eGAXVoOXM0AtK6kSzpuN1PzFUZGiPsLfSKaKHSA Ge/V2k95WZVgVLEMuXR6YaiEzIq2io+J2Z/GzkppYtTOzbHezxTm767BxHFYrb7yIKvT /rLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YrabLdOQ; 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 jl28si7888935ejc.233.2021.09.13.13.06.32; Mon, 13 Sep 2021 13:06:57 -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=YrabLdOQ; 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 S243417AbhIMNqA (ORCPT + 99 others); Mon, 13 Sep 2021 09:46:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:43056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241942AbhIMNkL (ORCPT ); Mon, 13 Sep 2021 09:40:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D62AC61283; Mon, 13 Sep 2021 13:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539766; bh=HVmiHrBeFNiqaH8sduhcxvABJ2yP4wydtgEcHmO945o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YrabLdOQPn/Cptra63nWzFhgUJZck34YZ50bzgEaEcFIiAl2b2EYN9DMzhjUpnfu3 QGKG/zdSDBs0d0Kd59ibS2KldRfLwuqyFaVFIt1xrE5a87uVhkNtWKSHhGDZdVceJN /cn2mcTrZtVuXMF9hzmx/HUGK209Wp7yH01XFPis= 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 5.10 152/236] usb: phy: twl6030: add IRQ checks Date: Mon, 13 Sep 2021 15:14:17 +0200 Message-Id: <20210913131105.529966413@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 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 8ba6c5a91557..ab3c38a7d8ac 100644 --- a/drivers/usb/phy/phy-twl6030-usb.c +++ b/drivers/usb/phy/phy-twl6030-usb.c @@ -348,6 +348,11 @@ static int twl6030_usb_probe(struct platform_device *pdev) twl->irq2 = platform_get_irq(pdev, 1); twl->linkstat = 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