[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161208021418.GD27638@dtor-ws>
Date: Wed, 7 Dec 2016 18:14:18 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Nick Dyer <nick@...anahar.org>
Cc: Andrew Duggan <aduggan@...aptics.com>,
Chris Healy <cphealy@...il.com>,
Henrik Rydberg <rydberg@...math.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8] Input: synaptics-rmi4 - add support for F34 V7
bootloader
Hi Nick,
On Mon, Dec 05, 2016 at 01:02:49AM +0000, Nick Dyer wrote:
> +static void rmi_f34v7_parse_img_header_10_bl_container(struct f34_data *f34,
> + const u8 *image)
> +{
> + int i;
> + u8 num_of_containers;
> + unsigned int addr;
> + unsigned int container_id;
> + unsigned int length;
> + const u8 *content;
> + struct container_descriptor *descriptor;
> +
> + BUG_ON(f34->v7.img.bootloader.size < 4);
> +
> + num_of_containers = (f34->v7.img.bootloader.size - 4) / 4;
> +
> + for (i = 1; i <= num_of_containers; i++) {
> + addr = le32_to_cpu(f34->v7.img.bootloader.data + (i * 4));
This cannot possibly be right. "f34->v7.img.bootloader.data + (i * 4)"
is a pointer in memory, you should not be converting it from le32.
Did you mean to use le32_to_cpup((__le32 *)(f34->v7.img.bootloader.data
+ (i * 4))) ?
Thanks.
--
Dmitry
Powered by blists - more mailing lists