Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2362540imm; Mon, 28 May 2018 06:45:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpiU6dRBfn1H9yJqdq4FAjEDbhAEjSoKqaFfN13D8Zu3oYTsBNqKlrSvMWUvs3AfHicg0Tg X-Received: by 2002:a63:93:: with SMTP id 141-v6mr10916074pga.322.1527515130986; Mon, 28 May 2018 06:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527515130; cv=none; d=google.com; s=arc-20160816; b=CQbbfFVr/S2nxS16i88T13lEP67gN0SNoYLipKHmclXgN3bqoIAtuqbC0quX4SZmJ7 4lAIW//iAJ+SNt5fDu/LSqcYaMwAfa87++n+FjWDWc5af9nRrTKpX4N38Sgs43oD7UDJ +l5ypL+dI6LX1axGr6rV1HTxMD5JtTR3jxTEpMsNEqDqg5XzgbMmq42JbULFJGdgnRjq ccuYzXjhTc+JoPgfX/dMiQ6aGPSlJLynrK0j68GRi34BzDUcPW1PmcOjpplFatSxZ45I irRXs8iZBNg1vY5yPOQG5I5/FBcdGo4AJy+kPIyjIm67bshcQYY6DsK2MpTB+jboq8j9 WSJQ== 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:dkim-signature :arc-authentication-results; bh=Lax0Krz4fL923TVN01v0yqp/0stQmC8n29qmFstQ+ns=; b=Q8uCMjvQVJ/TZT2zvQJ6z/TGTOWo/pELg/6z1mNgU+FlwrpmWlW1E7AVw0ENR84orv L69h1RU4LzO8Zdvhn1ql7szwhvd/MMG8M/X3A7VWdCqjQc4NDGpVMd756i1rbyMtgWPJ v//boH86sBrv/xVl8OuccivT6pb5caxDgdTG9IrntsIxPXEU3496T2dkHZ1HMc333VN8 7docK/rPAolRaMdHjBVK9INnbllX3S7h0ft1/R5A0w+tlBD0qr9BdRURO/DZ5jEFQwUe mutfFDkLcNSlo2BfUXR1PtfdOM0May2C5P97L6CCUTTWAgLtyYCkNQDp6V60FDzVGPPK mszg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rHdRTalD; 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 d7-v6si31057845pfe.214.2018.05.28.06.45.16; Mon, 28 May 2018 06:45:30 -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=rHdRTalD; 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 S937602AbeE1Knn (ORCPT + 99 others); Mon, 28 May 2018 06:43:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:34604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937413AbeE1Kni (ORCPT ); Mon, 28 May 2018 06:43:38 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 ABE9720844; Mon, 28 May 2018 10:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504218; bh=HDKsPp72L58lfe66xuYKU1rraoH1eMLMpsdrjErNiQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rHdRTalDVDnjEtnM0T8LIpaKKmAd6bVjqbFGaQDfmjt0T83NZgOsSeRLt8fgaNEql e3Q1t0AM5PvqSt2j6ruHCMadzknfDDGoBbT0k5PRIIxmjCvIIeYACJhm3wMwPUd/HG QswlsZPcr/5/mJ6leMXSo1gEh37qPwdw+nYRBsUU= 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 057/496] MIPS: generic: Fix machine compatible matching Date: Mon, 28 May 2018 11:57:22 +0200 Message-Id: <20180528100322.195730290@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@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; }