Skip to content

Commit

Permalink
video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data"
Browse files Browse the repository at this point in the history
'info->modes' got allocated with devm_kcalloc in of_get_pxafb_display.

This gives this error message:
  ./drivers/video/fbdev/pxafb.c:2238:2-7: WARNING: invalid free of devm_ allocated data

Fixes: c8f9630 ("video: fbdev: pxafb: switch to devm_* API")
Cc: stable@kernel.org [v4.19+]
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Daniel Mack <daniel@zonque.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
  • Loading branch information
YueHaibing authored and Bartlomiej Zolnierkiewicz committed Dec 20, 2018
1 parent f75df8d commit 2607391
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/video/fbdev/pxafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,10 +2234,8 @@ static struct pxafb_mach_info *of_pxafb_of_mach_info(struct device *dev)
if (!info)
return ERR_PTR(-ENOMEM);
ret = of_get_pxafb_mode_info(dev, info);
if (ret) {
kfree(info->modes);
if (ret)
return ERR_PTR(ret);
}

/*
* On purpose, neither lccrX registers nor video memory size can be
Expand Down

0 comments on commit 2607391

Please sign in to comment.