[Drbd-dev] [PATCH 03/13] DRBD-receiver: Move an assignment in receive_uuids()

SF Markus Elfring elfring at users.sourceforge.net
Sat Sep 10 22:24:42 CEST 2016


From: Markus Elfring <elfring at users.sourceforge.net>
Date: Sat, 10 Sep 2016 19:37:42 +0200

Move one assignment for the local variable "updated_uuids" so that
its setting will only be performed after corresponding memory
allocations succeeded by this function.

Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
---
 drivers/block/drbd/drbd_receiver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index dab3f74..5526f6b 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -4179,7 +4179,7 @@ static int receive_uuids(struct drbd_connection *connection, struct packet_info
 	struct drbd_device *device;
 	struct p_uuids *p = pi->data;
 	u64 *p_uuid;
-	int i, updated_uuids = 0;
+	int i, updated_uuids;
 
 	peer_device = conn_peer_device(connection, pi->vnr);
 	if (!peer_device)
@@ -4206,6 +4206,7 @@ static int receive_uuids(struct drbd_connection *connection, struct packet_info
 		return -EIO;
 	}
 
+	updated_uuids = 0;
 	if (get_ldev(device)) {
 		int skip_initial_sync =
 			device->state.conn == C_CONNECTED &&
-- 
2.10.0



More information about the drbd-dev mailing list