Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932376AbdLTIHj (ORCPT ); Wed, 20 Dec 2017 03:07:39 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:43356 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753206AbdLTIHe (ORCPT ); Wed, 20 Dec 2017 03:07:34 -0500 X-Google-Smtp-Source: ACJfBovFkMhSU7EcSwOdZBGZ/NFY5+QFd3qIGk2xqSycjLojwL6QXhNfX8yWNzLFuqKqdCsnM6tWmWdigMXk93E2SSM= MIME-Version: 1.0 In-Reply-To: <20171213085503.31899-1-quentin.schulz@free-electrons.com> References: <20171213085503.31899-1-quentin.schulz@free-electrons.com> From: Linus Walleij Date: Wed, 20 Dec 2017 09:07:32 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: axp209: dereference pointer after it's been set To: Quentin Schulz Cc: Chen-Yu Tsai , Maxime Ripard , linux-gpio@vger.kernel.org, "linux-kernel@vger.kernel.org" , Thomas Petazzoni , linux-sunxi , Mylene Josserand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id vBK87hjV012354 Content-Length: 632 Lines: 18 On Wed, Dec 13, 2017 at 9:55 AM, Quentin Schulz wrote: > The number of GPIOs is gotten from a field within the structure > referenced in the of_device.data but it was actually read before it was > retrieved, thus it was dereferencing a null pointer. > > Set the number of GPIOs after retrieving of_device.data. > > Fixes: e1190083b89b ("pinctrl: axp209: add support for AXP813 GPIOs") > > Signed-off-by: Quentin Schulz > Reported-by: Mylène Josserand Patch applied with the tags for test and ACK. Yours, Linus Walleij