Commit 66be340f authored by Pavel Machek's avatar Pavel Machek Committed by Rob Clark

drm/msm: fix leaks if initialization fails

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>
parent c479017f
......@@ -444,8 +444,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