lkml.org 
[lkml]   [2018]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] regmap: fix NULL pointer dereference in regmap_name_read_file()
From
Date
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.

\
 
 \ /
  Last update: 2018-01-24 17:05    [W:0.075 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site