Skip to content

Commit

Permalink
blockdev: drop unnecessary DriveBackupState field assignment
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Message-id: [email protected]
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
stefanhaRH authored and kevmw committed Dec 10, 2014
1 parent b756b9c commit 73f1f75
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 73f1f75

Please sign in to comment.