From 73f1f7564d58963fc692334bcf0c529e1e3536fb Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Fri, 21 Nov 2014 10:48:58 +0000 Subject: blockdev: drop unnecessary DriveBackupState field assignment 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(-) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index 490f698ce2..b58ce303a5 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; } -- cgit v1.2.3