]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
regulator: fix crash caused by null driver data
authorYu Zhao <yuzhao@google.com>
Wed, 19 Sep 2018 21:30:51 +0000 (15:30 -0600)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:16 +0000 (19:51 -0600)
commitc08bbe3f564d7bf814e236f719a25da3ae54fda9
tree3a92f803d330d708d0891619e01e145259978f88
parent7337b80781edab381494a361f9bb05305c810ff0
regulator: fix crash caused by null driver data

BugLink: https://bugs.launchpad.net/bugs/1836287
commit fb6de923ca3358a91525552b4907d4cb38730bdd upstream.

dev_set_drvdata() needs to be called before device_register()
exposes device to userspace. Otherwise kernel crashes after it
gets null pointer from dev_get_drvdata() when userspace tries
to access sysfs entries.

[Removed backtrace for length -- broonie]

Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/regulator/core.c