greybus: interpret descriptor type properly
authorAlex Elder <elder@linaro.org>
Tue, 9 Sep 2014 18:55:07 +0000 (13:55 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 9 Sep 2014 22:09:59 +0000 (15:09 -0700)
The type field in a manifest descriptor header is in little endian
format.  Make sure we interpret it that way.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/core.c

index 3bb8f9cb55f8ea125df4c4453e981bd14603bc3f..61a4bc6687e66ec3973ecc08f6938a301a5635af 100644 (file)
@@ -398,7 +398,7 @@ struct greybus_device *greybus_new_module(struct device *parent,
                desc = (struct greybus_descriptor *)data;
                desc_size = le16_to_cpu(desc->header.size);
 
-               switch (desc->header.type) {
+               switch (le16_to_cpu(desc->header.type)) {
                case GREYBUS_TYPE_FUNCTION:
                        retval = create_function(gdev, desc, desc_size);
                        break;