You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
drm/tegra: Fix small leak on error in tegra_fb_alloc()
If we don't have enough memory for ->planes then we leak "fb". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
committed by
Thierry Reding
parent
60c2f709d9
commit
6b7c79d191
@@ -100,8 +100,10 @@ static struct tegra_fb *tegra_fb_alloc(struct drm_device *drm,
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
fb->planes = kzalloc(num_planes * sizeof(*planes), GFP_KERNEL);
|
||||
if (!fb->planes)
|
||||
if (!fb->planes) {
|
||||
kfree(fb);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
fb->num_planes = num_planes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user