From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752489AbdLWKOC (ORCPT ); Sat, 23 Dec 2017 05:14:02 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:59640 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713AbdLWKN6 (ORCPT ); Sat, 23 Dec 2017 05:13:58 -0500 Date: Sat, 23 Dec 2017 10:13:21 +0000 From: Russell King - ARM Linux To: Arvind Yadav Cc: nsekhar@ti.com, khilman@kernel.org, kaloz@openwrt.org, khalasa@piap.pl, aaro.koskinen@iki.fi, tony@atomide.com, jason@lakedaemon.net, andrew@lunn.ch, sebastian.hesselbarth@gmail.com, gregory.clement@free-electrons.com, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, marek.vasut@gmail.com, slapin@ossfans.org, jic23@cam.ac.uk, kgene@kernel.org, krzk@kernel.org, ralf@linux-mips.org, ysato@users.sourceforge.jp, dalias@libc.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/11] constify gpio_led Message-ID: <20171223101321.GQ10595@n2100.armlinux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 20, 2017 at 02:17:41PM +0530, Arvind Yadav wrote: > gpio_led are not supposed to change at runtime. > struct gpio_led_platform_data working with const gpio_led > provided by . So mark the non-const structs > as const. Marking the structs as const is fine, but marking them __initconst is not. The GPIO LED driver can be built as a module, which means it can be loaded after the init sections have gone away. If that happens, then we de-reference the pointer to memory that has been freed. Please re-spin your patch set without the __initconst marking. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up