forked from Minki/linux
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: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
38d61ddf95
commit
1dd90df403
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user