Initialize header_size then data_size once. Signed-off-by: Fabian Frederick <f...@skynet.be> --- drivers/block/drbd/drbd_receiver.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index ad9b99b..3ca6516 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3556,18 +3556,16 @@ static int receive_SyncParam(struct drbd_connection *connection, struct packet_i return -EIO; } - if (apv <= 88) { + if (apv <= 88) header_size = sizeof(struct p_rs_param); - data_size = pi->size - header_size; - } else if (apv <= 94) { + else if (apv <= 94) header_size = sizeof(struct p_rs_param_89); - data_size = pi->size - header_size; - D_ASSERT(device, data_size == 0); - } else { + else header_size = sizeof(struct p_rs_param_95); - data_size = pi->size - header_size; + + data_size = pi->size - header_size; + if (apv > 88) D_ASSERT(device, data_size == 0); - } /* initialize verify_alg and csums_alg */ p = pi->data; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/