Commit 45e61801 authored by Pavel Machek's avatar Pavel Machek Committed by Greg Kroah-Hartman

drm/msm: fix leaks if initialization fails

[ Upstream commit 66be340f ]

We should free resources in unlikely case of allocation failure.
Signed-off-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 22840383
......@@ -495,8 +495,10 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
if (!dev->dma_parms) {
dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
GFP_KERNEL);
if (!dev->dma_parms)
return -ENOMEM;
if (!dev->dma_parms) {
ret = -ENOMEM;
goto err_msm_uninit;
}
}
dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment