[PATCH 03/13] DRBD-receiver: Move an assignment in receive_uuids()
From: SF Markus Elfring
Date: Sat Sep 10 2016 - 16:24:53 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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