From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 9B2AAC43381 for ; Mon, 1 Apr 2019 17:25:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CD9320830 for ; Mon, 1 Apr 2019 17:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139509; bh=EqXohSwUW3yVWgAkct3kJkCoHOGTJWq0r2BZqukaHrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Tj0950Y4sMTHUwv3wnXQe2uDnLFyTVd2tnAlC1dPxMY3fGfxCbJagcMj1GKZqqm9q dPtlUifD1Qj1g38IkBaqloWkW/i5KwshJfM6L5nO03f1BPUDjLAUn6uiMv+3Izv9iO xGXEB3yui8I3DCnSQBc/Vj2QQr69tfpUJgafURX8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732372AbfDARZI (ORCPT ); Mon, 1 Apr 2019 13:25:08 -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) {