diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index ffd7fffa5f83..fde806d6525b 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -400,7 +400,6 @@ static void vmbus_release_relid(u32 relid) void hv_process_channel_removal(struct vmbus_channel *channel) { - struct vmbus_channel *primary_channel; unsigned long flags; lockdep_assert_held(&vmbus_connection.channel_mutex); @@ -425,10 +424,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel) if (channel->primary_channel == NULL) { list_del(&channel->listentry); - - primary_channel = channel; } else { - primary_channel = channel->primary_channel; + struct vmbus_channel *primary_channel = channel->primary_channel; spin_lock_irqsave(&primary_channel->lock, flags); list_del(&channel->sc_list); spin_unlock_irqrestore(&primary_channel->lock, flags);