[media] cx88: fix NULL pointer dereference
authorHans Verkuil <hverkuil@xs4all.nl>
Wed, 29 May 2013 13:44:22 +0000 (10:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 8 Jun 2013 23:24:56 +0000 (20:24 -0300)
commit609c4c12af79b1ba5fd2d31727a95dd3a319c0ae
tree31d41ee5768f3d3ef56ad0c4d8aa75fb12a41a22
parentdfd50fc9030a62521838eecbe488e1962edcba80
[media] cx88: fix NULL pointer dereference

This fixes a NULL pointer deference when loading the cx88_dvb module for a
Hauppauge HVR4000.
The bugzilla bug report is here:
https://bugzilla.kernel.org/show_bug.cgi?id=56271
The cause is that the wm8775 is optional, so even though the board info says
there is one, it doesn't have to be there. Checking whether the module was
actually loaded is much safer.
Note that this driver is quite buggy when it comes to unloading and reloading
modules. Unloading cx8800 and reloading it again will still cause a crash,
most likely because either the i2c bus isn't unloaded at the right time and/or
the v4l2_device_unregister isn't called at the right time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Sebastian Frei <sebastian@familie-frei.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/pci/cx88/cx88-alsa.c
drivers/media/pci/cx88/cx88-video.c