Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: Daniel Mack <daniel@zonque.org>,
	b.zolnierkie@samsung.com, robert.jarzmik@free.fr
Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH -next] video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data"
Date: Mon, 19 Nov 2018 01:23:57 +0000	[thread overview]
Message-ID: <e8ab2a91-9779-5062-3a39-1b5ee1c824c7@huawei.com> (raw)
In-Reply-To: <ac93008d-05a0-834f-fcdd-649b0d12c212@zonque.org>


On 2018/11/17 4:05, Daniel Mack wrote:
> On 16/11/2018 12:02 PM, YueHaibing wrote:
>> '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>
> 
> Oh, yes. Thanks for spotting this!
> 
> Could you please add these lines to the patch and resubmit?
> 

Sure, will send v2.

> 
> Fixes: c8f96304ec8b4 ("video: fbdev: pxafb: switch to devm_* API")
> Cc: stable@kernel.org [v4.19+]
> Reviewed-by: Daniel Mack <daniel@zonque.org>
> 
> 
> 
> 
>> ---
>>   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
>>
> 
> 
> .
> 

  reply	other threads:[~2018-11-19  1:23 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 ` [PATCH -next] video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data" YueHaibing
2018-11-16 20:05   ` Daniel Mack
2018-11-19  1:23     ` YueHaibing [this message]
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=e8ab2a91-9779-5062-3a39-1b5ee1c824c7@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