Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp49450imu; Thu, 8 Nov 2018 14:34:05 -0800 (PST) X-Google-Smtp-Source: AJdET5fR3DxDgxK1ZpCZJfjQjWt/fn0lrmhLYGPchg309KUCBoOVSitmIBzQ1sczuSenWcw8yKx1 X-Received: by 2002:a62:8915:: with SMTP id v21-v6mr6544291pfd.137.1541716445808; Thu, 08 Nov 2018 14:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716445; cv=none; d=google.com; s=arc-20160816; b=fUVxRzeZb0pgxwa7TsjreJpuOprawegRiLGR1cu0Z2tCjfNxSMtf6pQbmo1mM824Eb +EZSHN3nI21KK7FXVF1PBKXphFIvXy7Bl5UiTNfhGIuhuHOx6CjxV597mxilUhDyaS80 2HeQ1veA2KvL4RwtjUkBDzEaOVzMnz0TDhllLHKgPIagkpbpb22hxiZuftjr/x3JoEsa +VZHnEl2bVd2hEjLK7pgeMC/qpMPV8spwqht2HdwVY590j4Vl1yjlaQs+Dcrc8ht1BIK CxVWRXejmn8R9VYf7Oi4fhdhLi+D7gBh9TOW4QOl4AdXPVtbukvk8R+A12td73dd03g6 hLTQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J0tQOu/7/VGdNErW9O0WtNsO2WYknkz+hFvuU+7Sm4A=; b=gSblaRIsIrlt2pJ8lAzOo4kss2LxUUgupf9GK2neRZaHR4s3Z9aOhedDRdzO+harXJ MJrMf0TqbmcfLpfJ4BhZeUbbSz7jFqJ7H25qB5Fj35vKmmMZzqsEyzZ70sLrKht3QAR7 72LCtdgqkp9xw+mat6wsHzJZiarXmqyJr1A6uGgEytOYl+UTKmtZTJn6xjvT0ETr3U3F mu25hrPQFa9Xa+IlYop1zZsU8L0ORdrjIirQ3TVqf9mAiGxTcPr9ORCwIPLm4CKaMmDj U5oT8Un4VQWDtjW/CUmx6vlpNyxzYsN3nXNUZvrJS2Hzuev4sJ1uMmBlrxXQY19+fxbK 5+ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q+mRNWPT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si5034213pgu.570.2018.11.08.14.33.50; Thu, 08 Nov 2018 14:34:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q+mRNWPT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730408AbeKIHhp (ORCPT + 99 others); Fri, 9 Nov 2018 02:37:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:56416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbeKIHhp (ORCPT ); Fri, 9 Nov 2018 02:37:45 -0500 Received: from localhost (unknown [208.72.13.198]) (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 CB81A21019; Thu, 8 Nov 2018 22:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714416; bh=dLNwI7uXil7hs3lJLZ5wIP07UFmByyojbDIsAIcuQJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+mRNWPT80P51baIpsYDEtE7D1izEVzvq1TKWsOJ8KnMZ+ihinexgZH6jAi2brBRC hL0PWVesm53QPnP+tAyQKEy/iUM0bnRy2wX83B9Ng9XsbmgsRJsStkprzU7xEVrACw U+jY6RXQmPE2KmnQ9jrxZGZLjoULeQmQIb75gVaw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Sasha Levin Subject: [PATCH 4.4 070/114] usb: imx21-hcd: fix error return code in imx21_probe() Date: Thu, 8 Nov 2018 13:51:25 -0800 Message-Id: <20181108215107.390810182@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 46edf52d08342b3dc1f9a61c5200ab8b1c0f5a37 ] platform_get_irq() returns an error code, but the imx21-hcd driver ignores it and always returns -ENXIO. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print error message and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/imx21-hcd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c index f542045dc2a6..e25d72e0527f 100644 --- a/drivers/usb/host/imx21-hcd.c +++ b/drivers/usb/host/imx21-hcd.c @@ -1849,8 +1849,10 @@ static int imx21_probe(struct platform_device *pdev) if (!res) return -ENODEV; irq = platform_get_irq(pdev, 0); - if (irq < 0) - return -ENXIO; + if (irq < 0) { + dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq); + return irq; + } hcd = usb_create_hcd(&imx21_hc_driver, &pdev->dev, dev_name(&pdev->dev)); -- 2.17.1