All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: s5p-mfc: fix incorrect bus assignment in virtual child device
       [not found] <CGME20190107120420eucas1p179b227d5ff0e040540ed9f48573e6e73@eucas1p1.samsung.com>
@ 2019-01-07 12:04 ` Marek Szyprowski
  2019-01-07 15:29   ` Paweł Chmiel
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Szyprowski @ 2019-01-07 12:04 UTC (permalink / raw)
  To: linux-media, linux-samsung-soc
  Cc: Marek Szyprowski, Sylwester Nawrocki, Andrzej Hajda, Paweł Chmiel

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").

Reported-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Fixes: c79667dd93b0 ("media: s5p-mfc: replace custom reserved memory handling code with generic one")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 927a1235408d..ca11f8a7569d 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1089,7 +1089,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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: s5p-mfc: fix incorrect bus assignment in virtual child device
  2019-01-07 12:04 ` [PATCH] media: s5p-mfc: fix incorrect bus assignment in virtual child device Marek Szyprowski
@ 2019-01-07 15:29   ` Paweł Chmiel
  0 siblings, 0 replies; 2+ messages in thread
From: Paweł Chmiel @ 2019-01-07 15:29 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-media, linux-samsung-soc, Sylwester Nawrocki, Andrzej Hajda

Dnia poniedziałek, 7 stycznia 2019 13:04:14 CET Marek Szyprowski pisze:
> 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").
> 
> Reported-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> Fixes: c79667dd93b0 ("media: s5p-mfc: replace custom reserved memory handling code with generic one")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 927a1235408d..ca11f8a7569d 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -1089,7 +1089,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;
> 

Checked on Samsung Galaxy S and not it's not crashing anymore. Thanks for patch.
Tested-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-07 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190107120420eucas1p179b227d5ff0e040540ed9f48573e6e73@eucas1p1.samsung.com>
2019-01-07 12:04 ` [PATCH] media: s5p-mfc: fix incorrect bus assignment in virtual child device Marek Szyprowski
2019-01-07 15:29   ` Paweł Chmiel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.