Received: from eggs.gnu.org ([2001:4830:134:3::10]:36363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmyy2-0006xD-Qb for qemu-devel@nongnu.org; Fri, 16 Oct 2015 02:58:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zmyxz-0003sN-KK for qemu-devel@nongnu.org; Fri, 16 Oct 2015 02:58:18 -0400 From: Alberto Garcia In-Reply-To: <1444924467-26433-1-git-send-email-stefanha@redhat.com> References: <1444924467-26433-1-git-send-email-stefanha@redhat.com> Date: Fri, 16 Oct 2015 08:58:12 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: fix memory leak in early exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: kwolf@redhat.com, Fam Zheng , qemu-block@nongnu.org On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi wrote: > The stream block job has two early exit code paths. They do not free > s->backing_file_str. > > Also, the early exits rely on the fact that the coroutine hasn't yielded > yet and was launched from the main thread. Therefore the coroutine is > guaranteed to be running in the main thread where block_job_completed() > may be called safely. This is very subtle so it's nice to eliminate the > assumption by unifying the early exit with the normal exit code path. > > Cc: Fam Zheng > Cc: Jeff Cody > Signed-off-by: Stefan Hajnoczi I had a slightly simpler version of this in my intermediate block streaming series in case you're interested: https://patchwork.ozlabs.org/patch/471881/ But this one looks good to me too, so: Reviewed-by: Alberto Garcia Berto