Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237574

Re: [PATCH] drm/gma500: fix double freeing

From Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] drm/gma500: fix double freeing
Date 2015-10-01 19:10 +0200
Message-ID <qePwK-2pD-13@gated-at.bofh.it> (permalink)
References <q6N8L-3wZ-11@gated-at.bofh.it> <qch69-7ye-15@gated-at.bofh.it> <qe38K-7J7-7@gated-at.bofh.it> <qeiUa-53l-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 30, 2015 at 8:12 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> On Tue, Sep 29, 2015 at 03:20:35PM +0200, Patrik Jakobsson wrote:
>> On Thu, Sep 24, 2015 at 5:57 PM, Sudip Mukherjee
>> <sudipm.mukherjee@gmail.com> wrote:
>> > On Wed, Sep 09, 2015 at 06:20:40PM +0530, Sudip Mukherjee wrote:
>> >> If backing->stolen is true then we were freeing backing by calling
>> >> psb_gtt_free_range() but we called it again after unlocking the mutex.
>> >> Lets make it NULL after freeing in psb_gtt_free_range() and check for
>> >> NULL before calling the function for the second time.
>> >>
>> >> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>> >> ---
>> > Hi Patrik,
>> > A gentle ping.
>> >
>> > regards
>> > sudip
>>
>> Hi, sorry for the late reply.
>>
>> Why are we freeing the range twice in the first case?
> I think,
> if backing->stolen is true then backing is released using
> psb_gtt_free_range() but if backing->stolen is false then the gem object
> is freed but the backing is not yet freed. To free that backing
> psb_gtt_free_range() has been called second time. My patch tried to fix
> the possibility of backing->stolen being true and backing being freed 2
> times.
>
> regards
> sudip

There are some special handling of the stolen framebuffer that I don't
remember entirely but the basic concept is that we free the backing
when we drop the last reference on a gem object. That will trigger a
psb_gtt_free_range(). So in this case it looks to me that the extra
free is not needed at all. That's my quick reasoning, feel free to
prove me wrong :)

Thanks
Patrik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] drm/gma500: fix double freeing Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-24 18:00 +0200
  Re: [PATCH] drm/gma500: fix double freeing Patrik Jakobsson <patrik.r.jakobsson@gmail.com> - 2015-09-29 15:30 +0200
    Re: [PATCH] drm/gma500: fix double freeing Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-30 08:20 +0200
      Re: [PATCH] drm/gma500: fix double freeing Patrik Jakobsson <patrik.r.jakobsson@gmail.com> - 2015-10-01 19:10 +0200
        Re: [PATCH] drm/gma500: fix double freeing Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-10-02 18:00 +0200

csiph-web