All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Nick Dyer <nick@shmanahar.org>
Cc: Andrew Duggan <aduggan@synaptics.com>,
	Chris Healy <cphealy@gmail.com>,
	Henrik Rydberg <rydberg@bitmath.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8] Input: synaptics-rmi4 - add support for F34 V7 bootloader
Date: Wed, 7 Dec 2016 18:14:18 -0800	[thread overview]
Message-ID: <20161208021418.GD27638@dtor-ws> (raw)
In-Reply-To: <1480899769-31330-1-git-send-email-nick@shmanahar.org>

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

  reply	other threads:[~2016-12-08  2:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05  1:02 [PATCH v8] Input: synaptics-rmi4 - add support for F34 V7 bootloader Nick Dyer
2016-12-08  2:14 ` Dmitry Torokhov [this message]
2016-12-11  0:14   ` Nick Dyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161208021418.GD27638@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=aduggan@synaptics.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=cphealy@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@shmanahar.org \
    --cc=rydberg@bitmath.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.