- tools: hv: Improve error logging in VSS daemon.
[opensuse:kernel-source.git] / patches.suse / msft-hv-0539-Drivers-hv-vmbus-Fix-a-bug-in-the-handling-of-channe.patch
1 From: "K. Y. Srinivasan" <kys@microsoft.com>
2 Date: Mon, 26 Aug 2013 14:08:58 -0700
3 Patch-mainline: v3.12-rc1
4 Subject: Drivers: hv: vmbus: Fix a bug in the handling of channel offers
5 Git-commit: 42dceebe34600b2d02a38baa3e869009ba3d14c7
6
7 The channel state should be correctly set before registering the device. In the current
8 code the driver probe would fail for channels that have been rescinded and subsequently
9 re-offered. Fix the bug.
10
11 Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
12 Cc: stable <stable@vger.kernel.org> # 3.11
13 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14 Acked-by: <ohering@suse.de>
15 ---
16  drivers/hv/channel_mgmt.c | 14 +++++++-------
17  1 file changed, 7 insertions(+), 7 deletions(-)
18
19 diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
20 index 12ec8c8..bbff5f2 100644
21 --- a/drivers/hv/channel_mgmt.c
22 +++ b/drivers/hv/channel_mgmt.c
23 @@ -293,6 +293,13 @@ static void vmbus_process_offer(struct work_struct *work)
24         }
25  
26         /*
27 +        * This state is used to indicate a successful open
28 +        * so that when we do close the channel normally, we
29 +        * can cleanup properly
30 +        */
31 +       newchannel->state = CHANNEL_OPEN_STATE;
32 +
33 +       /*
34          * Start the process of binding this offer to the driver
35          * We need to set the DeviceObject field before calling
36          * vmbus_child_dev_add()
37 @@ -318,13 +325,6 @@ static void vmbus_process_offer(struct work_struct *work)
38                 kfree(newchannel->device_obj);
39  
40                 free_channel(newchannel);
41 -       } else {
42 -               /*
43 -                * This state is used to indicate a successful open
44 -                * so that when we do close the channel normally, we
45 -                * can cleanup properly
46 -                */
47 -               newchannel->state = CHANNEL_OPEN_STATE;
48         }
49  }
50