From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyecA-0000Yn-S1 for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xyec4-00086K-EP for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyec4-000864-7d for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:20 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBAAZJoi005207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Dec 2014 05:35:19 -0500 From: Kevin Wolf Date: Wed, 10 Dec 2014 11:34:05 +0100 Message-Id: <1418207679-32260-40-git-send-email-kwolf@redhat.com> In-Reply-To: <1418207679-32260-1-git-send-email-kwolf@redhat.com> References: <1418207679-32260-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 39/73] blockdev: drop unnecessary DriveBackupState field assignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com From: Stefan Hajnoczi 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 Reviewed-by: Max Reitz Message-id: 1416566940-4430-3-git-send-email-stefanha@redhat.com Signed-off-by: Kevin Wolf --- blockdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 490f698..b58ce30 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1489,8 +1489,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; } -- 1.8.3.1