summaryrefslogtreecommitdiff
path: root/drivers/nvmem/brcm_nvram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvmem/brcm_nvram.c')
-rw-r--r--drivers/nvmem/brcm_nvram.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c
index 34130449f2d2..39aa27942f28 100644
--- a/drivers/nvmem/brcm_nvram.c
+++ b/drivers/nvmem/brcm_nvram.c
@@ -98,6 +98,9 @@ static int brcm_nvram_parse(struct brcm_nvram *priv)
len = le32_to_cpu(header.len);
data = kzalloc(len, GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
memcpy_fromio(data, priv->base, len);
data[len - 1] = '\0';