Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp808860ybk; Wed, 13 May 2020 13:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmW94C6SpzOz1MaOGFpZxRM2NwhCtooINYyK4Ss/U/EuvzKIzbDOGNDkyOlH9dZNjkPirb X-Received: by 2002:aa7:d44a:: with SMTP id q10mr1376422edr.386.1589402712603; Wed, 13 May 2020 13:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589402712; cv=none; d=google.com; s=arc-20160816; b=X0fK+iIREErO3AXdIRqy7jCo+N5b+YdZWep1IX+0xfATJUAUCypChtJBTxLPwvv5Qf 5ti0uKd5WETySA0CRHHoJZ3I6lPKw7aztdLqxqHX1j209HLY0qnK1escjAzmdGK/m5Fy flUF+WQpksxcNyjtHe3cUI+pBjZg9sA+CU8yWQvrDsMd46ZlnAJLGf1COM9GD5afa1gb hj6BgPae6PNErMmzh+J0v+jVz3GO8zqigvvSjAq7g87Ns3sTyyUqVNtNqYZz1aXnUcws ZpdTii+Tcvkby9G6rBjffRdWRNEvuwQcDObPs02iTXRNqvrKOzzx/AEs9LGJwhrbz/Z7 1lSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=EZk+0xYyWf0/juqMS5O3D+sI3AbzRD69wUjpk0hd0OE=; b=SooEsgJqTTJkdPtxLj7M8HEifS5SOgIiygxgTtVRyMmbT4Cy4fU2v628K9SyUc2pRd s9uMyjPMm6UzVPqEGscbkuyY9VZ9mqXt3dQPJfRq+vgcP56mrHmrZ3HiXjtQdRDuD/1M wv933W2teBGfgQQ4oHI9cSV5fZZj9/cJgqvp77Cw6V+hF37JDqGEuFWNdbgiY7LiKbQc 0DIlSwtjDbgm/+RzTLl/P90N9TA9CHmKSO7ZR8GIpIEn9YwzLWR1Y7CSH5ZKShUGDyHU 9slAB2Gd3u54iLPyHKBHCpydLmaU3CbOjDK0DmcW0yXAgwYEkkbwPl7Lo6+VRaGaeb9b b/kQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si581672ejc.29.2020.05.13.13.44.49; Wed, 13 May 2020 13:45:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387814AbgEMN0d (ORCPT + 99 others); Wed, 13 May 2020 09:26:33 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:10926 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733066AbgEMN0b (ORCPT ); Wed, 13 May 2020 09:26:31 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee95ebbf56d3c6-d0732; Wed, 13 May 2020 21:26:07 +0800 (CST) X-RM-TRANSID: 2ee95ebbf56d3c6-d0732 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.1.172.85]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95ebbf56c23b-4af97; Wed, 13 May 2020 21:26:07 +0800 (CST) X-RM-TRANSID: 2ee95ebbf56c23b-4af97 From: Tang Bin To: gregkh@linuxfoundation.org, stern@rowland.harvard.edu Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Tang Bin , Zhang Shengju Subject: [PATCH v2] USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe() Date: Wed, 13 May 2020 21:26:47 +0800 Message-Id: <20200513132647.5456-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function ehci_mxc_drv_probe() does not perform sufficient error checking after executing platform_get_irq(), thus fix it. Fixes: 7e8d5cd93fa ("USB: Add EHCI support for MX27 and MX31 based boards") Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin --- Changes from v1 - fix the subject. --- 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 c9f91e6c7..7f65c8604 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) -- 2.20.1.windows.1