From: YueHaibing <yuehaibing@huawei.com>
To: <b.zolnierkie@samsung.com>, <daniel@zonque.org>,
<robert.jarzmik@free.fr>
Cc: <linux-kernel@vger.kernel.org>, <linux-fbdev@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH -next] video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data"
Date: Fri, 16 Nov 2018 19:02:55 +0800 [thread overview]
Message-ID: <20181116110255.19736-1-yuehaibing@huawei.com> (raw)
'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
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/video/fbdev/pxafb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index bbed039..d59c8a5 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
--
2.7.0
next reply other threads:[~2018-11-16 11:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20181116110325epcas4p1a18c4e9d98ede25027bc198065d988dd@epcas4p1.samsung.com>
2018-11-16 11:02 ` YueHaibing [this message]
2018-11-16 20:05 ` [PATCH -next] video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data" Daniel Mack
2018-11-19 1:23 ` YueHaibing
2018-12-20 16:55 ` Bartlomiej Zolnierkiewicz
2018-12-20 16:56 ` Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181116110255.19736-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=b.zolnierkie@samsung.com \
--cc=daniel@zonque.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).