MLK-16302-1 drm/imx: dpu: plane: Free dpu_plane when bailout from dpu_plane_init
The dpu_plane is allocated with kzalloc() in dpu_plane_init(). In case, dpu_plane_init() fails after that allocation, the bailout path should free the dpu_plane, otherwise, there will be memory leakage. Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit 99cb80f855aafbe524519db635c3d03bd4cc8d85)pull/10/head
parent
a767b27ad8
commit
aed3e47d01
|
@ -988,8 +988,10 @@ struct dpu_plane *dpu_plane_init(struct drm_device *drm,
|
|||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
if (ret) {
|
||||
kfree(dpu_plane);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return dpu_plane;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue