From 42dceebe34600b2d02a38baa3e869009ba3d14c7 Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Mon, 26 Aug 2013 14:08:58 -0700 Subject: Drivers: hv: vmbus: Fix a bug in the handling of channel offers The channel state should be correctly set before registering the device. In the current code the driver probe would fail for channels that have been rescinded and subsequently re-offered. Fix the bug. Signed-off-by: K. Y. Srinivasan Cc: stable # 3.11 Signed-off-by: Greg Kroah-Hartman --- drivers/hv/channel_mgmt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/hv') diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 12ec8c801b25..bbff5f200bef 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -292,6 +292,13 @@ static void vmbus_process_offer(struct work_struct *work) return; } + /* + * This state is used to indicate a successful open + * so that when we do close the channel normally, we + * can cleanup properly + */ + newchannel->state = CHANNEL_OPEN_STATE; + /* * Start the process of binding this offer to the driver * We need to set the DeviceObject field before calling @@ -318,13 +325,6 @@ static void vmbus_process_offer(struct work_struct *work) kfree(newchannel->device_obj); free_channel(newchannel); - } else { - /* - * This state is used to indicate a successful open - * so that when we do close the channel normally, we - * can cleanup properly - */ - newchannel->state = CHANNEL_OPEN_STATE; } } -- cgit v1.2.3