From f560b127ca9bb7c52106f0f83091e6c5e0e90b09 Mon Sep 17 00:00:00 2001 From: Matej Kupljen Date: Wed, 28 Sep 2016 18:37:23 +0200 Subject: [PATCH] Reverse the order in disconnect When the device is disconnected, we first need to set interface data to NULL and then do the freeing of resources to avoid race conditions. Signed-off-by: Matej Kupljen --- drivers/net/usb/hso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index b0df61f..16aef06 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -3013,10 +3013,10 @@ exit: /* device removed, cleaning up */ static void hso_disconnect(struct usb_interface *interface) { - hso_free_interface(interface); - /* remove reference of our private data */ usb_set_intfdata(interface, NULL); + + hso_free_interface(interface); } static void async_get_intf(struct work_struct *data) -- 2.7.4