[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc425b3a-a22e-003a-f9c7-80398f91ae1c@lechnology.com>
Date: Wed, 24 Jan 2018 10:04:46 -0600
From: David Lechner <david@...hnology.com>
To: Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 1/2] regmap: fix NULL pointer dereference in
regmap_name_read_file()
On 01/24/2018 05:30 AM, Mark Brown wrote:
> On Tue, Jan 23, 2018 at 04:53:42PM -0600, David Lechner wrote:
>
>> This fixes a possible NULL pointer dereference oops in
>> regmap_name_read_file() when the regmap does not have a device
>> associated with it.
>
> How are you managing to get a regmap without a device associated with
> it?
>
I'm using syscon_regmap_lookup_by_compatible(), which calls:
regmap_init_mmio(NULL, base, &syscon_config)
NULL being the struct device *dev parameter.
There are several clock drivers that do that as well. I'm writing
another clock driver and will need to do the same thing for some non-DT
boards. I tried using a device, but clocks are initialized fairly early
in the boot process and kobject is not initialized yet, so you can't
register a platform device at that point.
Powered by blists - more mailing lists