Skip to content

Commit

Permalink
Drivers: hv: vmbus: Fix a bug in the handling of channel offers
Browse files Browse the repository at this point in the history
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>
Cc: stable <stable@vger.kernel.org> # 3.11
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 28, 2013
1 parent ef22d57 commit 42dceeb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 42dceeb

Please sign in to comment.