diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2013-08-26 14:08:58 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-14 07:06:46 -0700 |
commit | a493880d86c8bf516c63a4f3a50b39832f35acc1 (patch) | |
tree | b809455ba48ec538dfca22adf6f21154f2e4d379 | |
parent | 5d6d1d5cc50b4226d63303f061ebf2662395b627 (diff) |
Drivers: hv: vmbus: Fix a bug in the handling of channel offers
commit 42dceebe34600b2d02a38baa3e869009ba3d14c7 upstream.
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 <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/hv/channel_mgmt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 0df75908200e..461f47b6691e 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -262,6 +262,13 @@ static void vmbus_process_offer(struct work_struct *work) } /* + * 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 * vmbus_child_dev_add() @@ -287,13 +294,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; } } |