Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2502438imm; Mon, 24 Sep 2018 05:33:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Ljgw8QAJU7tpOait/n+9JeVuMpZCVy3dA0SLbj+D6/HDausnOE5AjKUeqc6oTwCHSmizS X-Received: by 2002:a63:e855:: with SMTP id a21-v6mr9342879pgk.4.1537792426422; Mon, 24 Sep 2018 05:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792426; cv=none; d=google.com; s=arc-20160816; b=aRultrZOe74Qa8YksnBU22JnHVlWupmqxOmGBOAOXeYpsXJYMHDzXVBNqzGofA5IqY AKn7ujlKNLESsj1Bm3TmjQwP6OegPD8oVkaDSdt9BjLn0jEg3MAFS382K3VYdW2DzGBm zVYyYbZhVMXfYjWyjOBkRBdmniecYJvQ2JlgkVn1Sj9A1pjci2w9QgtHhR3YknJXnIRg ytTG1lxotlOEBJaJ6kpYD9+fqTYYVGE4vKQyAmY7WtIkG2Nn8/xAyh/+xVhQ4lS7LefD s8Nmk5XlfG7aYUpcECCz0uuEnhZfbqSwCRxLw+FiYBFOeLoVNtmlQRMSW7svQujIbvuy xPxQ== 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; bh=yOgOI3WLdHK4Kzgp19fPZfq1icndTR5Fzd9OiP/OPJY=; b=nMACbcuiHYTpVIp3hUiOPLBGVmhbmFXA2U5o04MUO+mg2HoHQBH5HD4nL8/gAvLqbI Jdu/SW6sVuqdUV8oD2zDgihhadnmfybWYP8CN4zWY8LRoYuLUZhS5ekMlE6qRIg+qJpC 6r4KwMMV43XVdUiBQa1aQxl2jWr+GM6TaaT+TPcrhtbsY4tWWTfk824WqjnKrxoqIXr6 h6SXcYWBNnoTtJ/8n71wRhU/nf/LsbJUVBmSQFHztlK+Zc8kXS6QVUNoNiPwlD4DHctC 3RBGP1j3UlKw+Hlnu0pdwl47vc7qwO2g0ujXNIuOYzVfbCzeUrzee4/Bgrz3PdvIw13Q rmHg== 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 p184-v6si13525443pga.536.2018.09.24.05.33.30; Mon, 24 Sep 2018 05:33:46 -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 S2388132AbeIXSeJ (ORCPT + 99 others); Mon, 24 Sep 2018 14:34:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730184AbeIXSeJ (ORCPT ); Mon, 24 Sep 2018 14:34:09 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 77763109A; Mon, 24 Sep 2018 12:32:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Alex Elder , Andy Gross , Sasha Levin Subject: [PATCH 4.18 081/235] soc: qcom: smem: Correct check for global partition Date: Mon, 24 Sep 2018 13:51:07 +0200 Message-Id: <20180924113113.174689680@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bjorn Andersson [ Upstream commit 0b65c59e3a5475895c93ea5f130597db16b8abf6 ] The moved check for the global partition ended up in the wrong place and I failed to spot this in my review. This moves it to the correct place. Fixes: 11d2e7edac6a ("soc: qcom: smem: check sooner in qcom_smem_set_global_partition()") Signed-off-by: Bjorn Andersson Reviewed-by: Alex Elder Signed-off-by: Andy Gross Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/soc/qcom/smem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -364,11 +364,6 @@ static int qcom_smem_alloc_private(struc end = phdr_to_last_uncached_entry(phdr); cached = phdr_to_last_cached_entry(phdr); - if (smem->global_partition) { - dev_err(smem->dev, "Already found the global partition\n"); - return -EINVAL; - } - while (hdr < end) { if (hdr->canary != SMEM_PRIVATE_CANARY) goto bad_canary; @@ -736,6 +731,11 @@ static int qcom_smem_set_global_partitio bool found = false; int i; + if (smem->global_partition) { + dev_err(smem->dev, "Already found the global partition\n"); + return -EINVAL; + } + ptable = qcom_smem_get_ptable(smem); if (IS_ERR(ptable)) return PTR_ERR(ptable);