From patchwork Tue Jun 23 19:55:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 675D1C433E1 for ; Tue, 23 Jun 2020 21:16:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 375D720702 for ; Tue, 23 Jun 2020 21:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592946997; bh=JDSh+1V572z9jZUQRWMKQO0oJiV9fKv2CkxQ59qd/bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oZ6YPlTDd87wUAtJ4HF/3U+YFX7RM/6eapFR9koB+xZgheDvfySPqjshIntwz9mDz pZSlquaCVoFVqnp6AX64Ls/UqXyE/NTb9SizyULroUe9CwX7z1YVhH22+udNFxSIMb xya2pqr02tJ73LJpW25LqmJ4+wQY08DTzi9MeE+8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388823AbgFWVQY (ORCPT ); Tue, 23 Jun 2020 17:16:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:47250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390784AbgFWU1j (ORCPT ); Tue, 23 Jun 2020 16:27:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37C4120780; Tue, 23 Jun 2020 20:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944059; bh=JDSh+1V572z9jZUQRWMKQO0oJiV9fKv2CkxQ59qd/bk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/POu5EXk2+aSRQaFzKN4ux/p6jVuN4SdlXvnJlnt8xRtUk/XemDqxKtIq2PK2QIt 8vWdPokbYbeOgGmSZHDyi+oPr1J+R4cxU895XNYd5YrB5yNJ34Um2yVcU7vYqQ1RSk d+2/CFAGRuaD0cx1oZxMnPQib2ifSg/JCtFhSUVc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Shengju , Tang Bin , Peter Chen , Sasha Levin Subject: [PATCH 5.4 156/314] USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe() Date: Tue, 23 Jun 2020 21:55:51 +0200 Message-Id: <20200623195346.298267473@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195338.770401005@linuxfoundation.org> References: <20200623195338.770401005@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tang Bin [ Upstream commit d49292025f79693d3348f8e2029a8b4703be0f0a ] The function ehci_mxc_drv_probe() does not perform sufficient error checking after executing platform_get_irq(), thus fix it. Fixes: 7e8d5cd93fac ("USB: Add EHCI support for MX27 and MX31 based boards") Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20200513132647.5456-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ehci-mxc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index c9f91e6c72b6a..7f65c86047ddd 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c @@ -50,6 +50,8 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; hcd = usb_create_hcd(&ehci_mxc_hc_driver, dev, dev_name(dev)); if (!hcd)