projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
215a02f
)
mtd: zero out mtd_partition struct before using it
author
Brian Norris
<computersforpeace@gmail.com>
Thu, 12 Nov 2015 00:47:52 +0000
(16:47 -0800)
committer
Brian Norris
<computersforpeace@gmail.com>
Thu, 12 Nov 2015 18:10:01 +0000
(10:10 -0800)
It's easier to guarantee we've cleared out all unused fields with
memset() than by manually initializing each field.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/mtdpart.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mtd/mtdpart.c
b/drivers/mtd/mtdpart.c
index f8ba153f63bfebc5750a6d31b109dbc9d574cef8..46dfbf5629c31ad9f1e948f7e38d454b62c0d3c7 100644
(file)
--- a/
drivers/mtd/mtdpart.c
+++ b/
drivers/mtd/mtdpart.c
@@
-596,11
+596,10
@@
int mtd_add_partition(struct mtd_info *master, const char *name,
if (length <= 0)
return -EINVAL;
+ memset(&part, 0, sizeof(part));
part.name = name;
part.size = length;
part.offset = offset;
- part.mask_flags = 0;
- part.ecclayout = NULL;
new = allocate_partition(master, &part, -1, offset);
if (IS_ERR(new))