From: Greg Kroah-Hartman Date: Sun, 14 Sep 2014 00:28:19 +0000 (-0700) Subject: greybus: core: verify major/minor number of greybus protocol X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a1dc62b0c8efe79f27d048d03daac4764cb7c46c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: core: verify major/minor number of greybus protocol --- diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 1d9efd4b5f59..bad40bafae4c 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -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);