Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[firefly-linux-kernel-4.4.55.git] / drivers / hv / channel_mgmt.c
index 12ec8c801b25f87bf58321777bb816594915ac72..bbff5f200bef7a7b070abec6c0f7c202f335159c 100644 (file)
@@ -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;
        }
 }