From patchwork Tue Sep 29 11:00:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263400 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=-13.5 required=3.0 tests=BAYES_00,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=ham 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 C6209C47423 for ; Tue, 29 Sep 2020 11:05:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C3B021D7D for ; Tue, 29 Sep 2020 11:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377521; bh=sEnncAE7swknYM9ucIJ06y04dkrQWy4QGw1RueM3EMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SAJxC58TeyN8X28daPTemy+1OkYtSh8H6lC6hBMfiQGljkIqqXC+RswtE20u5Wak6 4s+PQ39/zdTtk1WibuzyGCSW9AmNdq3742GcHpm/qHC5j4eaNHhnVwp8/OfuHlHvmq Y6UC8OTHaX5LfRaVh1QWa/e6e+aKe6E2S5gJu4T0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbgI2LFU (ORCPT ); Tue, 29 Sep 2020 07:05:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:41424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbgI2LFG (ORCPT ); Tue, 29 Sep 2020 07:05:06 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 2F1BF21734; Tue, 29 Sep 2020 11:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377505; bh=sEnncAE7swknYM9ucIJ06y04dkrQWy4QGw1RueM3EMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQdInCTcapPK9nke3sL4Wg0X6X9W1QcMSUC9PYdKqUJ/VLwOHwdzW6wqAkDd1XDfI 3zYuB5E8tvKH6bF5tuLtNJ7AabWyFE8b2QHX8Y5e1PLgPSiL0ONpq8DPhVNsxvoR6W e0N/kAh3uuAzJc/8Qy4YvEak9iwztoh3uVOw4ppI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Shengju , Tang Bin , Sasha Levin Subject: [PATCH 4.4 58/85] USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe() Date: Tue, 29 Sep 2020 13:00:25 +0200 Message-Id: <20200929105931.116849835@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tang Bin [ Upstream commit c856b4b0fdb5044bca4c0acf9a66f3b5cc01a37a ] If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in mv_ehci_probe(). And when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20200508114305.15740-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ehci-mv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 849806a75f1ce..273736e1d33fa 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -197,9 +197,8 @@ static int mv_ehci_probe(struct platform_device *pdev) hcd->regs = ehci_mv->op_regs; hcd->irq = platform_get_irq(pdev, 0); - if (!hcd->irq) { - dev_err(&pdev->dev, "Cannot get irq."); - retval = -ENODEV; + if (hcd->irq < 0) { + retval = hcd->irq; goto err_disable_clk; }