From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753827AbbI3GMu (ORCPT ); Wed, 30 Sep 2015 02:12:50 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33846 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753103AbbI3GMs (ORCPT ); Wed, 30 Sep 2015 02:12:48 -0400 Date: Wed, 30 Sep 2015 11:42:41 +0530 From: Sudip Mukherjee To: Patrik Jakobsson Cc: David Airlie , Daniel Vetter , linux-kernel , dri-devel Subject: Re: [PATCH] drm/gma500: fix double freeing Message-ID: <20150930061241.GC3500@sudip-pc> References: <1441803040-15998-1-git-send-email-sudipm.mukherjee@gmail.com> <20150924155725.GE10109@sudip-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 29, 2015 at 03:20:35PM +0200, Patrik Jakobsson wrote: > On Thu, Sep 24, 2015 at 5:57 PM, Sudip Mukherjee > 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 > >> --- > > 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