diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-12-20 19:13:08 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-13 09:51:10 +0100 |
commit | c1aa0c845c36a37f4119c42d974f4cfb653da192 (patch) | |
tree | e509f73f08d8fd7cb15eface61f08e5cab3ed5bd /drivers/video | |
parent | 9797226bf661499ddfb7d754d155f594d5742f5e (diff) | |
download | linux-rpi3-c1aa0c845c36a37f4119c42d974f4cfb653da192.tar.gz linux-rpi3-c1aa0c845c36a37f4119c42d974f4cfb653da192.tar.bz2 linux-rpi3-c1aa0c845c36a37f4119c42d974f4cfb653da192.zip |
video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data"
commit 2607391882fca37463187e7f2a9c76dec286947e upstream.
'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: c8f96304ec8b4 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/pxafb.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index bbed039617a4..d59c8a59f582 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -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 |