Skip to contentSkip to conversation

drm/armada: Fix a potential double free in armada_drm_bind

PATCH New Miaoqian Lin 1 participant 1 message Apr 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/armada: Fix a potential double free in armada_drm_bind

priv is a managed resource allocated with devm_drm_dev_alloc(), so there is no need to call kfree() explicitly or there will be a double free.

Fixes 90ad200b4cbc ("drm/armada: Use devm_drm_dev_alloc")
---
 drivers/gpu/drm/armada/armada_drv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/armada/armada_drv.c +0 -1
index 0643887800b4..142668cd6d7c 100644
@@ -99,7 +99,6 @@ static int armada_drm_bind(struct device *dev)
 	if (ret) {
 		dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n",
 			__func__, ret);
-		kfree(priv);
 		return ret;
 	}
 
Signature · 1 line
2.17.1