From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 49DE41A1EFB for ; Thu, 15 Sep 2016 06:30:49 -0700 (PDT) Received: by mail-qt0-x22a.google.com with SMTP id 93so24187455qtg.2 for ; Thu, 15 Sep 2016 06:30:49 -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=6BjzCc5+y4SVaQNOoEBGv1io4n6wYcsyq2k+chSVkmw=; b=JKm2VMsAXyXgK7YPEH9xcBtBsj3MghhV2uQaaZNSj0pt6vQRl/8gGrBRrzhmNLa2Je vwzueAnj+DUz5g1/rU3mCDgWz7yJhxo+6Lbm/F44gISfLImKLFRRleDx/M6vTdyKy5G2 XF62OQgVp9ikch8IfF82f8t/Dvyw7BwGj7ieo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6BjzCc5+y4SVaQNOoEBGv1io4n6wYcsyq2k+chSVkmw=; b=WdvPHP2yms9FDO0qUCF6eL70Y/ej8sJ/i16tVAHVhrcYXmUAtLoQJOMr9r/n/5OIde 5aMjt0kGX88KyHpUADQ45/lnQxhf27LVwSSdgr/14CbD78UkbYyo0/y33StW6p6DSjT4 Wjj4xlB6DSohhfOqourGYHftqAi3ZsoZDfvoF4uDJ1EHrYoA3M68dLtNKLJ1oNNk7rje Ski7gTwvxnN1KfCebgrMXusrPrb9ORgzrrvgfBeMUawvw3J8x0sra6MBtTEh+mCeR5i+ jI+Xm6yEg/AcZFp1C4q82k0Bv0Q5GPrPnurNtMtB1hatkPBIEwse2M8Po1CCNn4xGmPk aEcA== X-Gm-Message-State: AE9vXwNDv3Gq0xM+8Qc6ib5OHZh4gxj2E139G7cJYRzJOay6W1eBCe8Zj8YG7J7ccxp99vuu X-Received: by 10.28.134.8 with SMTP id i8mr2951126wmd.59.1473946248272; Thu, 15 Sep 2016 06:30:48 -0700 (PDT) Received: from localhost.localdomain ([160.168.239.246]) by smtp.gmail.com with ESMTPSA id r9sm3532696wjp.15.2016.09.15.06.30.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 06:30:47 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Cc: zhaoshenglong@huawei.com, sakar.arora@nxp.com, Ard Biesheuvel Date: Thu, 15 Sep 2016 14:30:30 +0100 Message-Id: <1473946233-10547-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473946233-10547-1-git-send-email-ard.biesheuvel@linaro.org> References: <1473946233-10547-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [PATCH 1/4] ArmVirtPkg/FdtClientDxe: fix check for size of "reg" properties X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 13:30:49 -0000 Currently, the code in FdtClientDxe assumes #address-cells and of tuples, this means the size of the entire property should always be a multiple of 16 bytes (i.e, 4 * sizeof(UINT32), not 8. So fix this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index c336e2410033..2063a597323b 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -178,7 +178,7 @@ FindCompatibleNodeReg ( return Status; } - if ((*RegSize % 8) != 0) { + if ((*RegSize % 16) != 0) { DEBUG ((EFI_D_ERROR, "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n", __FUNCTION__, CompatibleString, *RegSize)); -- 2.7.4