projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38d61dd
)
greybus: manifest: make sure manifest_descs list is empty before parsing manifest
author
Viresh Kumar
<viresh.kumar@linaro.org>
Fri, 14 Nov 2014 11:55:03 +0000
(17:25 +0530)
committer
Greg Kroah-Hartman
<greg@kroah.com>
Fri, 14 Nov 2014 21:32:27 +0000
(13:32 -0800)
Just an extra check to make sure the list isn't corrupted.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/manifest.c
patch
|
blob
|
history
diff --git
a/drivers/staging/greybus/manifest.c
b/drivers/staging/greybus/manifest.c
index
d1357a2
..
4b85c53
100644
(file)
--- a/
drivers/staging/greybus/manifest.c
+++ b/
drivers/staging/greybus/manifest.c
@@
-332,6
+332,10
@@
bool gb_manifest_parse(struct gb_module *gmod, void *data, size_t size)
u32 found = 0;
bool result;
+ /* Manifest descriptor list should be empty here */
+ if (WARN_ON(!list_empty(&manifest_descs)))
+ return false;
+
/* we have to have at _least_ the manifest header */
if (size <= sizeof(manifest->header)) {
pr_err("short manifest (%zu)\n", size);