mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 17:05:48 +07:00
drm/msm: fix leaks if initialization fails
We should free resources in unlikely case of allocation failure. Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
parent
c479017faa
commit
66be340f82
@ -444,8 +444,10 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
|
|||||||
if (!dev->dma_parms) {
|
if (!dev->dma_parms) {
|
||||||
dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
|
dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!dev->dma_parms)
|
if (!dev->dma_parms) {
|
||||||
return -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
goto err_msm_uninit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
|
dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user