linux/sound/soc/rockchip
Enric Balletbo i Serra 5f22449344 ASoC: rockchip-max98090: Fix NULL pointer dereference while accessing to jack.
Commit f2ed6b0764 ("ASoC: Make aux_dev more like a generic
component") caused a regression on this driver, since now a
kernel oops is seen when rockchip-mac98090 driver is loaded.

That commit changed the probing of aux_devs before checking
new DAI links, so for this driver rk_98090_headset_init is
called before rk_init and then the kernel oops due a NULL
pointer dereference inside rk_98090_headset_init function
since there is a call that tries to access the jack pointer
which has not been allocated yet.

This is the call chain that causes the crash:

 rk_98090_headset_init
   -> ts3a227e_enable_jack_detect
      -> snd_jack_set_key
 rk_init
   -> snd_soc_card_jack_new

This patch moves the new jack object creation from rk_init
to rk_98090_headset_init function making sure the jack is
created before is accessed.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30 16:19:41 +01:00
..
Kconfig ASoC: rockchip: Add rockchip SPDIF transceiver driver 2015-10-08 16:12:01 +01:00
Makefile ASoC: rockchip: Add rockchip SPDIF transceiver driver 2015-10-08 16:12:01 +01:00
rockchip_i2s.c ASoC: rockchip: i2s: configure the sdio pins' iomux mode 2016-05-30 16:19:41 +01:00
rockchip_i2s.h ASoC: rockchip: i2s: configure the sdio pins' iomux mode 2016-05-30 16:19:41 +01:00
rockchip_max98090.c ASoC: rockchip-max98090: Fix NULL pointer dereference while accessing to jack. 2016-05-30 16:19:41 +01:00
rockchip_rt5645.c ASoC: rockchip-rt5645: Allow more sample rates 2015-11-16 10:10:24 +00:00
rockchip_spdif.c ASoC: rockchip: add bindings for spdif controller 2016-03-05 12:59:06 +09:00
rockchip_spdif.h Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/es8328', 'asoc/fix/fsl-sai', 'asoc/fix/rockchip', 'asoc/fix/sgtl5000' and 'asoc/fix/wm8974' into asoc-linus 2015-12-23 00:23:27 +00:00