From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751156AbdALUNs (ORCPT ); Thu, 12 Jan 2017 15:13:48 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:4544 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbdALUNq (ORCPT ); Thu, 12 Jan 2017 15:13:46 -0500 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 12 Jan 2017 12:13:45 -0800 Subject: Re: [PATCH] pinctrl: Initialize pinctrl_dev.node To: Thierry Reding , Linus Walleij References: <20170112160334.22943-1-thierry.reding@gmail.com> CC: , From: Jon Hunter Message-ID: <492f05b7-5b41-16ab-5d8a-83801d617e9a@nvidia.com> Date: Thu, 12 Jan 2017 20:13:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170112160334.22943-1-thierry.reding@gmail.com> X-Originating-IP: [10.26.11.50] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/01/17 16:03, Thierry Reding wrote: > From: Thierry Reding > > 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 > Signed-off-by: Thierry Reding Thanks for catching this. Acked-by: Jon Hunter Tested-by: Jon Hunter Cheers Jon -- nvpublic