Commit a1dc62b0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: core: verify major/minor number of greybus protocol

parent 543b8ed2
......@@ -385,7 +385,15 @@ struct greybus_device *greybus_new_module(struct device *parent,
version_major = manifest->header.version_major;
version_minor = manifest->header.version_minor;
// FIXME - check version major/minor here!
/* Validate major/minor number */
if ((version_major != GREYBUS_VERSION_MAJOR) ||
(version_minor != GREYBUS_VERSION_MINOR)) {
dev_err(parent,
"Invalid greybus versions, expected %d.%d, got %d.%d\n",
GREYBUS_VERSION_MAJOR, GREYBUS_VERSION_MINOR,
version_major, version_minor);
goto error;
}
size -= sizeof(manifest->header);
data += sizeof(manifest->header);
......
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