Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp495778yba; Mon, 1 Apr 2019 10:27:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqydMIxUqmKdw8jnBC0YvtETywKW13izNbjwi9XykYrxBY1sNAOTiDeAnbYrZVCFyrw31Iau X-Received: by 2002:aa7:8458:: with SMTP id r24mr29776366pfn.231.1554139628732; Mon, 01 Apr 2019 10:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554139628; cv=none; d=google.com; s=arc-20160816; b=HC5x2V941AqBoGjeLT2iUkeocEwwvdC0swQJy3z4GYcmZMfxP/j6BbCofMLhUS85f6 QEkM2uwfx0qv68ZIqtLkYbxPmLzoPxwtFJSxG2e2RjbsAJaHj/W6dHk0F67XaJi3i+ix RiguoyCLWieYcp6ccLEGgoAJHOW7NDCRSeDOP9CFyi0T908PllYF2t35cn5WUgCHUXb5 vizCkBbdvqY3s69+I5sEf4191XSlq0Q62lgHGLpSllZBUIp1CXj0eI2dEKthejNDmTT6 2IsbYzFGfWP/aX3Z9MC0DmbJtF9tMbUyBAH15EP4tczIEo1VmUXQqQVHL6DnBEJ2AbMK Vk6Q== 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=Ur8jzp8S8/l7CIk6cA7Hf6bducumflaP7JPj2kpV6uk=; b=Aw5m4srnzB/K8ejcPTrVyYE7+snSzFKtzxBBsHbY4AjhOP0VJ5yek/C9+0Cjviaeq/ ycgIAWL6tAZyPataJ+KIzp53d6hdSOn1MuJftEzrPsiKdiYsVHphvX9n+WlNyP6vD/L1 awI+TynItUiLmnVAd0TTlQ1dMO4kA/mKah2B3DGNOHfvzgKxD2+A2yDJiykr2rA6aAW7 LNhK0orohNlpAvq0djHmbIhu7kYUwqb+mVB1qyeP7tpUDpOSv/QtH0oX/FTb7uq57aZI eJqa7LhAMiSgURVx2iH0HI4mgnl2IQPRmOZ2FfCFAD/0Dx0yqaZJCErmChjK9vSU2+1Z OmEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Orn5HNFg; 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 g8si8964850plt.141.2019.04.01.10.26.53; Mon, 01 Apr 2019 10:27:08 -0700 (PDT) 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=Orn5HNFg; 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 S1732368AbfDARZH (ORCPT + 99 others); Mon, 1 Apr 2019 13:25:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:56104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731767AbfDARZE (ORCPT ); Mon, 1 Apr 2019 13:25:04 -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 DEEDA2063F; Mon, 1 Apr 2019 17:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139504; bh=EqXohSwUW3yVWgAkct3kJkCoHOGTJWq0r2BZqukaHrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Orn5HNFg5zx158bZK4rFGlZ2zOrUjFwdWve87tEZiK8xkj0GgCaph5DGy/jTo3VCf zQKLMeKRCXG7UGbuFzit1RGge8cFZys+kX8NcUD4DpSF4zTDCpiSAUCmNcWVXQ+YnW yMCHk0aIfRi9QFmE3mkje2BbXhMYmlgkkIIHbtA8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabrizio Castro Subject: [PATCH 4.14 096/107] usb: common: Consider only available nodes for dr_mode Date: Mon, 1 Apr 2019 19:02:51 +0200 Message-Id: <20190401170054.406343177@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170045.246405031@linuxfoundation.org> References: <20190401170045.246405031@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fabrizio Castro commit 238e0268c82789e4c107a37045d529a6dbce51a9 upstream. There are cases where multiple device tree nodes point to the same phy node by means of the "phys" property, but we should only consider those nodes that are marked as available rather than just any node. Fixes: 98bfb3946695 ("usb: of: add an api to get dr_mode by the phy node") Cc: stable@vger.kernel.org # v4.4+ Signed-off-by: Fabrizio Castro Signed-off-by: Greg Kroah-Hartman --- drivers/usb/common/common.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -148,6 +148,8 @@ enum usb_dr_mode of_usb_get_dr_mode_by_p do { controller = of_find_node_with_property(controller, "phys"); + if (!of_device_is_available(controller)) + continue; index = 0; do { if (arg0 == -1) {