Received: by 10.192.165.148 with SMTP id m20csp546153imm; Wed, 25 Apr 2018 04:03:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+j51QA0p6iYtRlMRQ/DnE5Nfaye2KtrN9+M1aXAwub3+bW0OiGZaYc6a1S7fnmI1zo5fUm X-Received: by 2002:a17:902:1347:: with SMTP id r7-v6mr24041735ple.62.1524654202760; Wed, 25 Apr 2018 04:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654202; cv=none; d=google.com; s=arc-20160816; b=cxpWt79kah8Yisglt9MhfYVZ0lz2Vxg5XYyEwgknv/0xhXnX1cWXioNGNZQgu1bSyj T+KJvVTH+RhU29FxK1NcskzvHu1xy32flr/GFIXP+KPnaIPPgN61LpnaDq4orOz559AP a6Bs7GPNBbSao51SGMJ7DZ63yWKGzxMHPZ1oGnN8LHLrZ/Kgy0IYbF3qht6r7evroP8i O4tsZpqpAIUdPfIK/D0bX/B518lGqauwaBnWpxT+pncgCCLk0FoEVJWA5WqnryXTtaKK 8Pw2JD27nixk8wrk1NSv5l7HyXK/+c0iS7bXg0br1rIv9ISTQ6eQPH21IEmOY56dCYb9 bqkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9soK/cKGXPcbfOnCnWgGhSMz4WzB4sjDZ75djWAnzAM=; b=mPS1bTYzAHvDMrBjZYnKDlbt/jcZgvBQse1S9y3NHl80egWrl7YwuhleZrUacEOOfm Vs6LnPrG5V+HbBqP7Oyu2tNnQdn1tHq2O+dgbAp4xz3gS9yyVQ1VW6ETDIppBuiyhyhZ ySFNhJfPgmxxz0Ar3n6IQjuIdPZMBdSzBbXC45HBqLz8+5zpffW69FWEn/F7XV6Ks59V mYgCAzpYcKogD+bBxib77ZpdS+5Olti9OPAROpZbuRizdaHfFuCktOB6kcQyLZP02nps l+f62ojGcBL0Pl0Q0gPYlN+UPfNfYEUwEjsB/44XFekrDpL5TD0/fA9rgB7pn4xZWWiX vZUw== ARC-Authentication-Results: i=1; mx.google.com; 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 t16si15724170pfm.150.2018.04.25.04.03.07; Wed, 25 Apr 2018 04:03:22 -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; 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 S1754262AbeDYLCI (ORCPT + 99 others); Wed, 25 Apr 2018 07:02:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52734 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753748AbeDYKmo (ORCPT ); Wed, 25 Apr 2018 06:42:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9D370272; Wed, 25 Apr 2018 10:42:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hogan , Paul Burton , Matt Redfearn , Ralf Baechle , linux-mips@linux-mips.org, Sasha Levin Subject: [PATCH 4.14 134/183] MIPS: generic: Fix machine compatible matching Date: Wed, 25 Apr 2018 12:35:54 +0200 Message-Id: <20180425103247.804488864@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: James Hogan [ Upstream commit 9a9ab3078e2744a1a55163cfaec73a5798aae33e ] We now have a platform (Ranchu) in the "generic" platform which matches based on the FDT compatible string using mips_machine_is_compatible(), however that function doesn't stop at a blank struct of_device_id::compatible as that is an array in the struct, not a pointer to a string. Fix the loop completion to check the first byte of the compatible array rather than the address of the compatible array in the struct. Fixes: eed0eabd12ef ("MIPS: generic: Introduce generic DT-based board support") Signed-off-by: James Hogan Reviewed-by: Paul Burton Reviewed-by: Matt Redfearn Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18580/ Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/mips/include/asm/machine.h +++ b/arch/mips/include/asm/machine.h @@ -52,7 +52,7 @@ mips_machine_is_compatible(const struct if (!mach->matches) return NULL; - for (match = mach->matches; match->compatible; match++) { + for (match = mach->matches; match->compatible[0]; match++) { if (fdt_node_check_compatible(fdt, 0, match->compatible) == 0) return match; }