Commit 1dd90df4 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: manifest: make sure manifest_descs list is empty before parsing manifest

Just an extra check to make sure the list isn't corrupted.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 38d61ddf
......@@ -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);
......
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