mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Thierry Reding <thierry.reding@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: Initialize pinctrl_dev.node
Date: Thu, 12 Jan 2017 20:13:39 +0000	[thread overview]
Message-ID: <492f05b7-5b41-16ab-5d8a-83801d617e9a@nvidia.com> (raw)
In-Reply-To: <20170112160334.22943-1-thierry.reding@gmail.com>



On 12/01/17 16:03, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The struct pinctrl_dev's node field is not properly set up, which means
> the .prev and .next fields will be NULL. That's not something that the
> linked list code can deal with, so extra care must be taken when using
> these fields. An example of this is introduced in commit 3429fb3cda34
> ("pinctrl: Fix panic when pinctrl devices with hogs are unregistered")
> where list_del() is made conditional on the pinctrl device being part
> of the pinctrl device list. This is to ensure that list_del() won't
> crash upon encountering a NULL pointer in .prev and/or .next.
> 
> After initializing the list head there's no need to jump through these
> extra hoops and list_del() will work unconditionally. This is because
> the initialized list head points to itself and therefore the .prev and
> .next fields can be properly dereferenced.
> 
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Thanks for catching this.

Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon

-- 
nvpublic

  reply	other threads:[~2017-01-12 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 16:03 Thierry Reding
2017-01-12 20:13 ` Jon Hunter [this message]
2017-01-13 15:32 ` Linus Walleij

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=492f05b7-5b41-16ab-5d8a-83801d617e9a@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®