Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1828114pxb; Mon, 13 Sep 2021 06:27:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxSzjVEsRs1I4bLVyDxVn9HmHL7yyBeCDarMhm9ia6TXd9jAaWSEQKCFSVHPrynYBJnwQF X-Received: by 2002:a05:6402:4247:: with SMTP id g7mr13289257edb.287.1631539658040; Mon, 13 Sep 2021 06:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539658; cv=none; d=google.com; s=arc-20160816; b=1Bpp7sVZhbOLPSsEJYw9AnhW+6mT2+pA5qPsChakGfaj9BJdB7PEC560uVTBt2PgHP dSC0RWKk9yghFZZZCy6j7nRBcOfbXCQSI72esNnuGFFpdUAfXkTWwbGrrz4O5I9kngue d7Q+b+pafurFgPtfweDtDmiGtFyDO+M79HpStnLNSaO/JhtQmzhgw3S//Q2C6E4qWXEv gpnuMMsyeD/0gA0S0ixbLD03vgFvu9VZ5U4R6ViEzPdIJzNPoEUSXOFHbIAZi91Pynfz Rc0OWWTvMoTgUPoTrAWXm+WH34Aq6JsfLhIl8hEheeNA8erKSJsiZ/ifygsc4yYPPVV+ o1rw== 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=x/s+nPOWTC+LK2rcb3i6EAccIOymm4C87Boxf+U2OS8=; b=oQU4CvinltLo/9/eO5yMVDZiXuh/ry1JYD5u3ZqMIB49B0TOWLqSQNAIjv/wJJ6Ue9 U3H3EVzVvCpGQGBlKz+Wi3PgnWArB5oCtYG9QREP1UGvQuso4Af0VvCKxpSNpdL18ntK OOapUcpS0d7hS8aCcCADy18L4tWzRjkBrQOYk2iYHBntGGvka9BvDzygyB7ESGWpQ216 yK7sMEA3ZpWmyniLGdfO0CAtiZEbw8bOCQzSzimrwwn3lP8UICrlF50CL289iT5A/q1B p+YfdcwbsCBVAPW6eA80EUcOpAKp1iU1aGDp/gosGBAYFvrWfkw0QHzaxZsRzNH8DYzn mjEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B2WKqIW4; 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 f16si4512070edf.48.2021.09.13.06.27.13; Mon, 13 Sep 2021 06:27:38 -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=B2WKqIW4; 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 S241411AbhIMNYL (ORCPT + 99 others); Mon, 13 Sep 2021 09:24:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:38020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240160AbhIMNVt (ORCPT ); Mon, 13 Sep 2021 09:21:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94535610F7; Mon, 13 Sep 2021 13:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539233; bh=9hnF8+CnRoL2OmBCjCKNXSTd0852sHHFCZ5F952HWAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2WKqIW4AGr0fs8vK0Stporzi8n+FeBb/pfcqZi+AXLSawFpQqPrn3OiK/pCT1o+k LF8kPSexilm9MscMHdtr3qbkDKtAU2xhCSXnNfOldHKaQRz+MpN24Gm1cliqSyDuFe WlHdVbLD/68smkTceKevAad8XTPwFaqn8dVGcPXk= 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.4 090/144] usb: phy: twl6030: add IRQ checks Date: Mon, 13 Sep 2021 15:14:31 +0200 Message-Id: <20210913131050.961784753@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 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 9a7e655d5280..9337c30f0743 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