Commit 93867233 authored by Brian Norris's avatar Brian Norris

mtd: zero out mtd_partition struct before using it

It's easier to guarantee we've cleared out all unused fields with
memset() than by manually initializing each field.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 215a02fd
...@@ -596,11 +596,10 @@ int mtd_add_partition(struct mtd_info *master, const char *name, ...@@ -596,11 +596,10 @@ int mtd_add_partition(struct mtd_info *master, const char *name,
if (length <= 0) if (length <= 0)
return -EINVAL; return -EINVAL;
memset(&part, 0, sizeof(part));
part.name = name; part.name = name;
part.size = length; part.size = length;
part.offset = offset; part.offset = offset;
part.mask_flags = 0;
part.ecclayout = NULL;
new = allocate_partition(master, &part, -1, offset); new = allocate_partition(master, &part, -1, offset);
if (IS_ERR(new)) if (IS_ERR(new))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment