Message ID | 20180502011019.22812-6-elder@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp125224lji; Tue, 1 May 2018 18:12:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKQuiul30w7OgyCUcUpjz1mj79XVYjfk/r75j+0QtJGXv40USBxf4Wdy85jKw1FL0RD+4f X-Received: by 2002:a63:6ec7:: with SMTP id j190-v6mr14326866pgc.71.1525223560765; Tue, 01 May 2018 18:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525223560; cv=none; d=google.com; s=arc-20160816; b=UCvdxKS1Rfb/6eokXwvxRCvVAH+wggBTRt/ipjecV/sr7cTFZ8zihgYg4UGaY7Gael kqXBsFlJkLai4lek32+6MOT/n/TabD3IiiDmMHYHe5NjbiXR+lb2QFxHSavOBfGZcpAf a/ca7fdkPuMY9Lg6Vh48sRz6BGaI/TWW4xoftj6dfNltNvj11qVESy+Y05APGGpQkgw3 9IVy8v2LFb6HMCio8Lczybhz+q94i+9YqAMlPkDxwYlDZaYNqgM3lLRHZxXKdwVQHqlw jICqWIiZOp2fl18rw+1qG8+CNjULT5ZpMQV7FBeghBXPPFRDTEijpFfW/5VUoeqEbKy1 1Lsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=rUsjSto+doHhw2ElZggGnYookdq0o1rpr+mtuYUM2IY=; b=oYypZRGBn1CwZ/kqbbdG/51ZBxyDHibCdqCVeBHGeU27wd69drTYI5arR3WYUySB0n YsfSbHzKb+5HDRpmuTBKeIJ6Bj+UOfi2oXN62egZlTxwPblE9F1UkAvRmI3S9ml9pJyT 2/vXvQXvLXAjkF0x1BqNqbIT15TXW7L2hlNfSUEIhU3WZWaeYmpWy9JQz17ISIWiZEOX FjYCCQetq9Pg89k5gv2psBvWUGG4+wy+ZW9cIDtd+4CBff8ai2s4rT1CQlWLNyZvs9J9 +4BkM+qm0aqtZLwtTS/laUE6tL7VPp84UDhXLOVLz1+jb6eQsgnJXxXhofXpITBYgEhR PYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RJSb10vo; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <linux-arm-msm-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24-v6si9047045plo.489.2018.05.01.18.12.40; Tue, 01 May 2018 18:12:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RJSb10vo; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751167AbeEBBMi (ORCPT <rfc822;niklas.cassel@linaro.org> + 12 others); Tue, 1 May 2018 21:12:38 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:42382 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbeEBBKd (ORCPT <rfc822;linux-arm-msm@vger.kernel.org>); Tue, 1 May 2018 21:10:33 -0400 Received: by mail-io0-f196.google.com with SMTP id a10-v6so15576656ioc.9 for <linux-arm-msm@vger.kernel.org>; Tue, 01 May 2018 18:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+lEtxFJLX+XM1onKl5Obo+Yr4L4/r5icl+NOTkGiYUA=; b=RJSb10voUscmHHOSRmNi1f0xKOeNcVDRZbQVzW5FtK5z+BSV8eE6ibOWk/E1rz4I1Q PLZ8XsN8UaAkd1qIpfKLxBqy7PjCfO0W3kdOz9NJIKcbN5FMeDv/ERmNUDzad37wc/es hIZyvYU6Fl4vnE4Rt0HLDCx0q17OE71gCGNbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+lEtxFJLX+XM1onKl5Obo+Yr4L4/r5icl+NOTkGiYUA=; b=OQmrlFZrn+jGlehFgDYQP1BXiPVYlzbPWNRWXiUR1G6nQ8TbWrFBUFkAS0vgrkVXOD dM+corT+LfTkZQJU7qml+XFMuLAskvKdaDtJfzjeMqR/SxCSMhTz5khszKx2KoF2tJ1/ Ib+kzB5IhH44aN0Gs/MI+8HdD0yokcTaqR3Jn/s3+5gjq3bBkrTQcWzmGO2nkclfNbRE YfzhTc8+lEmjaytVYloz7I8Ms01qyr5bY16a0XSWGq21tYaNYSEzzX0l/mXcTXGcB5kU BMV5tRtvtgICnMMRGa9kbEI2ZaJSgOz1yDiZDkEfFgnnN2fjXOh3efVU+vS0yVp/1oY7 VlYA== X-Gm-Message-State: ALQs6tDPzF9YIhvTJr3bM+Vu+P3eFC3knIm0ZKkE7b7+MiteLfVMlyhh DvPYbJHJbhAl84bKCsNVo+lq8Q== X-Received: by 2002:a6b:88d:: with SMTP id h13-v6mr17876217ioi.43.1525223432660; Tue, 01 May 2018 18:10:32 -0700 (PDT) Received: from presto.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id g200-v6sm2082479itb.26.2018.05.01.18.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 18:10:32 -0700 (PDT) From: Alex Elder <elder@linaro.org> To: andy.gross@linaro.org Cc: clew@codeaurora.org, aneela@codeaurora.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/12] soc: qcom: smem: verify both host ids in partition header Date: Tue, 1 May 2018 20:10:12 -0500 Message-Id: <20180502011019.22812-6-elder@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180502011019.22812-1-elder@linaro.org> References: <20180502011019.22812-1-elder@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: <linux-arm-msm.vger.kernel.org> X-Mailing-List: linux-arm-msm@vger.kernel.org |
Series |
soc: qcom: smem: some refactoring
|
expand
|
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 5d3ed510e54b..6931602d9a9e 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -769,7 +769,7 @@ static int qcom_smem_set_global_partition(struct qcom_smem *smem) return -EINVAL; } - if (host0 != SMEM_GLOBAL_HOST && host1 != SMEM_GLOBAL_HOST) { + if (host0 != SMEM_GLOBAL_HOST || host1 != SMEM_GLOBAL_HOST) { dev_err(smem->dev, "Global partition hosts are invalid\n"); return -EINVAL; }
The global partition is indicated by having both host values in its table of contents entry equal SMEM_GLOBAL_HOST=0xfffe. In qcom_smem_set_global_partition(), we check whether the header structure at the beginning of the partition contains that host value, but the check only verifies *one* of them. Change the check so the partition header must have SMEM_GLOBAL_HOST for *both* its host fields. Signed-off-by: Alex Elder <elder@linaro.org> --- drivers/soc/qcom/smem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html