diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-07-29 17:21:17 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-11-30 15:32:08 +1100 |
commit | 578914cffc283b907777796420148d582072cbae (patch) | |
tree | 60d2d204b217524db1c3589d97306ce9323407a1 /arch/powerpc/kernel | |
parent | 36673307aee535f951f4eede81049c6962bc4ba9 (diff) | |
download | op-kernel-dev-578914cffc283b907777796420148d582072cbae.zip op-kernel-dev-578914cffc283b907777796420148d582072cbae.tar.gz |
powerpc/nvram: Ensure that the partition header/block size is right
Use BUILD_BUG_ON to ensure the structure representing a partition
header have the right size.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index a5a5587..f753882 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -565,6 +565,8 @@ static int __init nvram_init(void) int error; int rc; + BUILD_BUG_ON(NVRAM_BLOCK_LEN != 16); + if (ppc_md.nvram_size == NULL || ppc_md.nvram_size() <= 0) return -ENODEV; |