From: Alex Elder Date: Tue, 9 Sep 2014 18:55:07 +0000 (-0500) Subject: greybus: interpret descriptor type properly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a22e15a1fc8d46139c6ca4b17b81c14783d3f5a2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: interpret descriptor type properly 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 3bb8f9cb55f8..61a4bc6687e6 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -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;