Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp851198ybi; Fri, 12 Jul 2019 05:42:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyft2bbFPO2nebAdqYlW/BTVHbj0fuE4PQhR/RNAuDv0qnaAOpv9vFCTZ1tDQlkLUYHKNpa X-Received: by 2002:a17:90a:30aa:: with SMTP id h39mr11663783pjb.32.1562935345031; Fri, 12 Jul 2019 05:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935345; cv=none; d=google.com; s=arc-20160816; b=jZMWl6nlUfarP0jKgUcUcLhTQqkZIUTWJeY/2uNBNEjIfFFXbTQRAqGpPHBrpDQS6r eSruuhFkL5VjjvMtpnClG3N5f0XNsmWd3fCqZJH3WJQbOie85DDRSOQYUuw7NQAvOmGN ajT5fkMuvFdPjeUAYEz7WnOpAJXvFkVYpE9P184Gy0XIYZrtzo2PC5+M5qOVSMVhFrCh 6z/c9t+EUN49hfCTXgswqOtH96paIXmGQeGX40epER4DNAuILuD8DVDTfJbRfDUBLvP2 GL6YDSnEaxbqUqbskmWrLvTJBR1rfuIi8g+tAnD3KKH8xm6PkeAHWDsGAJJ9aa2HAeyX PT9g== 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=9Gka0r+ExkkYtBnLVdEhAQG6aY45DFYnLziGimA9iFs=; b=FjUbC26nOgXRQKReuX1pDTK6jcRHDXKwEveMjSAZeIN0Xoq/k40VuovEJaeh+bIy5C GSOmXSY5EsP0PenPa7bdOZBwHeuFcyZKeLM3gMf9aEYkVLBEnb5GWvzBx2ovWLjO98Fr 2NFi5M4j2W2+lx2iwxQklaeEpG6wul256Y4LClL+P98qn66dmnZ5Is5s+bHqFtYOd/L4 z7eBqtcE9dUZ6IiHGFYDThUKRPOOpjp4s18s1/u0jwc3790eHSTf4MNUm9Y32lcUDbX2 ES3Q61fv+JNVwlP7Idi8V5MyogxUNR52N4XKfq2QCLJS+3H/tU7K3MGNX0DEAd/vQ/8D vJSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BbwaeTEV; 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 y15si8074123pfe.133.2019.07.12.05.42.09; Fri, 12 Jul 2019 05:42:25 -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=BbwaeTEV; 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 S1728716AbfGLMlL (ORCPT + 99 others); Fri, 12 Jul 2019 08:41:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:36792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728042AbfGLM0E (ORCPT ); Fri, 12 Jul 2019 08:26: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 5EDB9208E4; Fri, 12 Jul 2019 12:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934363; bh=cWPcw6h9DHowQiZYU03G9tXISuDsNEaXKAX0VKfkxiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BbwaeTEVEm+4bnADiGuQd4b0Mw6dLzVP3gN4A6znUtqFSP0z9RCUopuOAscDCXkNI uHTi1StGK+ySEG61PpuFvJW1aiuFQZNSJIzgTQQzSEf7IBGx4iDzogaIh90LZlTQzf Y5dIo2fEWbVbtnJQIXka39ZM+j5Lc9DXANej3wv0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Sasha Levin Subject: [PATCH 5.1 008/138] soc: brcmstb: Fix error path for unsupported CPUs Date: Fri, 12 Jul 2019 14:17:52 +0200 Message-Id: <20190712121629.035725171@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 490cad5a3ad6ef0bfd3168a5063140b982f3b22a ] In case setup_hifcpubiuctrl_regs() returns an error, because of e.g: an unsupported CPU type, just catch that error and return instead of blindly continuing with the initialization. This fixes a NULL pointer de-reference with the code continuing without having a proper array of registers to use. Fixes: 22f7a9116eba ("soc: brcmstb: Correct CPU_CREDIT_REG offset for Brahma-B53 CPUs") Signed-off-by: Florian Fainelli Signed-off-by: Sasha Levin --- drivers/soc/bcm/brcmstb/biuctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soc/bcm/brcmstb/biuctrl.c b/drivers/soc/bcm/brcmstb/biuctrl.c index 6d89ebf13b8a..c16273b31b94 100644 --- a/drivers/soc/bcm/brcmstb/biuctrl.c +++ b/drivers/soc/bcm/brcmstb/biuctrl.c @@ -246,7 +246,9 @@ static int __init brcmstb_biuctrl_init(void) if (!np) return 0; - setup_hifcpubiuctrl_regs(np); + ret = setup_hifcpubiuctrl_regs(np); + if (ret) + return ret; ret = mcp_write_pairing_set(); if (ret) { -- 2.20.1