drm/exynos: iommu: move dma_params configuration code to separate functions
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 17 Jun 2016 07:54:23 +0000 (09:54 +0200)
committerInki Dae <daeinki@gmail.com>
Wed, 13 Jul 2016 14:06:04 +0000 (23:06 +0900)
commitf7c72773de88fa3d4b51d4eb2bd2a89b746aaf54
tree05a40dbdf33237547e0d2703027533a65fc12ca7
parent5dd0775e502b26b44e5bcb5f504a977a565f2f3e
drm/exynos: iommu: move dma_params configuration code to separate functions

Move code for managing DMA max segment size parameter to separate
functions. This patch also replaces devm_kzalloc() with kzalloc() and
adds proper kfree call. devm_kzalloc() cannot be used for dma_params
structure, because it will be freed on driver remove not on device
release. This means in case of Exynos DRM being compiled as module and
loaded 2 times, a user-after-free issue will happen.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_iommu.c