4.20-stable review patch.  If anyone has any objections, please let me know.

------------------

From: YueHaibing <[email protected]>

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: [email protected] [v4.19+]
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Daniel Mack <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/video/fbdev/pxafb.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2234,10 +2234,8 @@ static struct pxafb_mach_info *of_pxafb_
        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


Reply via email to