mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
hv: vmbus_free_channels(): remove the redundant free_channel()
free_channel() has been invoked in vmbus_remove() -> hv_process_channel_removal(), or vmbus_remove() -> ... -> vmbus_close_internal() -> hv_process_channel_removal(). We also change to use list_for_each_entry_safe(), because the entry is removed in hv_process_channel_removal(). This patch fixes a bug in the vmbus unload path. Thank Dan Carpenter for finding the issue! Signed-off-by: Dexuan Cui <[email protected]> Reported-by: Dan Carpenter <[email protected]> Cc: K. Y. Srinivasan <[email protected]> Cc: Vitaly Kuznetsov <[email protected]> Signed-off-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
096c605feb
commit
813c5b7958
1 changed files with 8 additions and 3 deletions
|
|
@ -212,11 +212,16 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
|
|||
|
||||
void vmbus_free_channels(void)
|
||||
{
|
||||
struct vmbus_channel *channel;
|
||||
struct vmbus_channel *channel, *tmp;
|
||||
|
||||
list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list,
|
||||
listentry) {
|
||||
/* if we don't set rescind to true, vmbus_close_internal()
|
||||
* won't invoke hv_process_channel_removal().
|
||||
*/
|
||||
channel->rescind = true;
|
||||
|
||||
list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
|
||||
vmbus_device_unregister(channel->device_obj);
|
||||
free_channel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue