2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-26 15:45:14 +08:00
linux-next/drivers/staging
Russell King d9fdb9fba7 imx-drm: imx-ldb: fix NULL pointer in imx_ldb_unbind()
When trying to unbind imx-drm, the following oops was observed from
the imx-ldb driver:

Unable to handle kernel NULL pointer dereference at virtual address 0000001c
pgd = de954000
[0000001c] *pgd=2e92c831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in: bnep rfcomm bluetooth nfsd exportfs hid_cypress brcmfmac brcmutil snd_soc_fsl_ssi snd_soc_fsl_spdif imx_pcm_fiq imx_pcm_dma imx_ldb(C) imx_thermal imx_sdma imx2_wdt snd_soc_sgtl5000 snd_soc_imx_sgtl5000 snd_soc_imx_spdif snd_soc_imx_audmux
CPU: 1 PID: 1228 Comm: bash Tainted: G         C    3.16.0-rc2+ #1229
task: ea378d80 ti: de948000 task.ti: de948000
PC is at imx_ldb_unbind+0x1c/0x58 [imx_ldb]
LR is at component_unbind+0x38/0x70
pc : [<bf025068>]    lr : [<c0353108>]    psr: 200f0013
sp : de949da8  ip : de949dc0  fp : de949dbc
r10: e9a44b0c  r9 : 00000000  r8 : de949f78
r7 : 00000012  r6 : e9b3f400  r5 : e9b133b8  r4 : e9b13010
r3 : 00000000  r2 : e9b3f400  r1 : ea9a0210  r0 : e9b13020
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 2e95404a  DAC: 00000015
Process bash (pid: 1228, stack limit = 0xde948240)
Stack: (0xde949da8 to 0xde94a000)
...
Backtrace:
[<bf02504c>] (imx_ldb_unbind [imx_ldb]) from [<c0353108>] (component_unbind+0x38/0x70)
[<c03530d0>] (component_unbind) from [<c03531d4>] (component_unbind_all+0x94/0xc8)
[<c0353140>] (component_unbind_all) from [<c04bc224>] (imx_drm_driver_unload+0x34/0x4c)
[<c04bc1f0>] (imx_drm_driver_unload) from [<c03394a4>] (drm_dev_unregister+0x2c/0xa0)
[<c0339478>] (drm_dev_unregister) from [<c0339f8c>] (drm_put_dev+0x30/0x6c)
[<c0339f5c>] (drm_put_dev) from [<c04bc1cc>] (imx_drm_unbind+0x14/0x18)
[<c04bc1b8>] (imx_drm_unbind) from [<c03530b4>] (component_master_del+0xbc/0xd8)
...
Code: e5904058 e2840010 e2845fea e59430a0 (e593301c)
---[ end trace 4f211c6dbbcd4963 ]---

This is caused by only having one channel out of the pair configured in
DT; the second channel remains uninitialised, but upon unbind, the
driver attempts to clean up both, thereby dereferencing a NULL pointer.
Avoid this by checking that the second channel is initialised.

Fixes: 1b3f767566 ("imx-drm: initialise drm components directly")
Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 12:10:28 -07:00
..
android staging: android: fix a possible memory leak 2014-08-17 07:15:10 -07:00
bcm Staging: bcm: Qos.c: checkpatch.pl fix: Indentation of case-statements fixed 2014-07-30 17:14:24 -07:00
board
comedi staging: comedi: addi_apci_1564: remove diagnostic interrupt support code 2014-08-01 15:37:22 -07:00
cptm1217
dgap staging: dgap: remove dgap_newnode() 2014-07-15 08:26:29 -07:00
dgnc staging: dgnc: Remove unneeded dgnc_trace.c and dgnc_trace.h 2014-08-01 14:50:04 -07:00
emxx_udc staging: emxx_udc: Fix coding style errors 2014-07-15 21:55:29 -07:00
et131x staging: et131x: Fix errors caused by phydev->addr accesses before initialisation 2014-08-17 07:07:55 -07:00
ft1000 staging: ft1000: remove procfs entries 2014-07-27 11:45:46 -07:00
fwserial
gdm72xx Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-08-06 09:38:14 -07:00
gdm724x Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-08-06 09:38:14 -07:00
goldfish staging/goldfish/goldfish_audio: fix a sparse warning 2014-07-23 18:12:23 -07:00
gs_fpgaboot
iio staging:iio:hmc5843: Add support for spi hmc5983 2014-07-23 21:48:24 +01:00
imx-drm imx-drm: imx-ldb: fix NULL pointer in imx_ldb_unbind() 2014-09-08 12:10:28 -07:00
line6
lustre staging: lustre: lustre: libcfs: workitem.c: Cleaning up missing null-terminate after strncpy call 2014-08-17 07:15:10 -07:00
media Staging driver patches for 3.17-rc1 2014-08-04 18:36:12 -07:00
mt29f_spinand
netlogic staging: netlogic: coding style fixup 2014-07-27 08:57:38 -07:00
nokia_h4p
nvec staging/nvec: Use platform_get_irq() 2014-07-30 17:18:47 -07:00
octeon staging: octeon: fix coding style 2014-07-15 08:32:55 -07:00
octeon-usb
olpc_dcon
ozwpan
panel
rtl8188eu staging: r8188eu: Add new USB ID 2014-08-25 15:00:56 -07:00
rtl8192e staging: use pci_zalloc_consistent 2014-08-08 15:57:30 -07:00
rtl8192ee staging: use pci_zalloc_consistent 2014-08-08 15:57:30 -07:00
rtl8192u staging:r8190: coding style: Fixed checkpatch reported Error 2014-08-01 14:42:52 -07:00
rtl8712 staging:rtl8712:mlme_linux.c: Adds blank lines to pass checkpatch.pl 2014-07-30 17:05:56 -07:00
rtl8723au staging: rtl8723au: Fix static symbol sparse warning 2014-08-01 14:44:01 -07:00
rtl8821ae staging: use pci_zalloc_consistent 2014-08-08 15:57:30 -07:00
rts5208 SCSI misc on 20140806 2014-08-06 20:10:32 -07:00
skein
slicoss staging: use pci_zalloc_consistent 2014-08-08 15:57:30 -07:00
speakup Update speakup mailing list address 2014-07-18 16:36:29 -07:00
ste_rmi4
unisys staging: visorchipset: fix sparse warnings about static declaration 2014-08-01 14:39:26 -07:00
vme staging: vme: removed useless breaks in vme_user.c 2014-07-23 18:21:59 -07:00
vt6655 staging: use pci_zalloc_consistent 2014-08-08 15:57:30 -07:00
vt6656 staging: vt6656: wcmd.h remove dead macros 2014-07-27 11:19:57 -07:00
wlan-ng Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-08-06 09:38:14 -07:00
xgifb
xillybus staging: xillybus: Removed outdated part in README 2014-07-17 17:18:44 -07:00
Kconfig usbip: move usbip kernel code out of staging 2014-08-25 10:40:06 -07:00
Makefile usbip: move usbip kernel code out of staging 2014-08-25 10:40:06 -07:00
staging.c