]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
media: s5p-mfc: fix incorrect bus assignment in virtual child device
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 7 Jan 2019 12:04:14 +0000 (07:04 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838824
[ Upstream commit 1e0d0a5fd38192f23304ea2fc2b531fea7c74247 ]

Virtual MFC codec's child devices must not be assigned to platform bus,
because they are allocated as raw 'struct device' and don't have the
corresponding 'platform' part. This fixes NULL pointer access revealed
recently by commit a66d972465d1 ("devres: Align data[] to
ARCH_KMALLOC_MINALIGN").

Fixes: c79667dd93b0 ("media: s5p-mfc: replace custom reserved memory handling code with generic one")
Reported-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/media/platform/s5p-mfc/s5p_mfc.c

index 59b8cc045fc9d316b01a50969753905feb418ff5..077dc8ab9a29e9c1263864efa0dadc0f077892a4 100644 (file)
@@ -1087,7 +1087,6 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
        device_initialize(child);
        dev_set_name(child, "%s:%s", dev_name(dev), name);
        child->parent = dev;
-       child->bus = dev->bus;
        child->coherent_dma_mask = dev->coherent_dma_mask;
        child->dma_mask = dev->dma_mask;
        child->release = s5p_mfc_memdev_release;