From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrlmA-0000HX-K9 for qemu-devel@nongnu.org; Fri, 21 Nov 2014 05:49:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xrlm2-0004My-0K for qemu-devel@nongnu.org; Fri, 21 Nov 2014 05:49:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrlm1-0004Mr-Pr for qemu-devel@nongnu.org; Fri, 21 Nov 2014 05:49:09 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sALAn9Qx001930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 21 Nov 2014 05:49:09 -0500 From: Stefan Hajnoczi Date: Fri, 21 Nov 2014 10:48:58 +0000 Message-Id: <1416566940-4430-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1416566940-4430-1-git-send-email-stefanha@redhat.com> References: <1416566940-4430-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] blockdev: drop unnecessary DriveBackupState field assignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , mreitz@redhat.com drive_backup_prepare() assigns DriveBackupState fields to NULL in the error path. This is unnecessary because the DriveBackupState is allocated using g_malloc0() and other functions like external_snapshot_prepare() already rely on this. Do not explicitly assign fields to NULL so that the error path is concise and does not require modification when fields are added to DriveBackupState. Signed-off-by: Stefan Hajnoczi --- blockdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 778509b..0d06983 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1475,8 +1475,6 @@ static void drive_backup_prepare(BlkTransactionState *common, Error **errp) &local_err); if (local_err) { error_propagate(errp, local_err); - state->bs = NULL; - state->job = NULL; return; } -- 2.1.0