hso: fix for crash when unplugging the device
Subsystems (4)
PATCH 1/2 hso: fix for crash when unplugging the device
From: Jan Dumon <[email protected]>
Changed the order in which things are freed. This fixes an oops when unplugging the device while network traffic is ongoing.
Signed-off-by Jan Dumon <[email protected]>
---
drivers/net/usb/hso.c +9 -2
@@ -5,6 +5,7 @@* Copyright (C) 2008 Option International * Filip Aben <[email protected]> * Denis Joseph Barrow <[email protected]> +* Jan Dumon <[email protected]> * Copyright (C) 2007 Andrew Bird (Sphere Systems Ltd) * <ajb-5+cxppFmGx6/3pe1ocb+s/[email protected]> * Copyright (C) 2008 Greg Kroah-Hartman <[email protected]>
@@ -2417,20 +2418,22 @@ static void hso_free_net_device(struct hso_device *hso_dev)if (!hso_net)return ; +remove_net_device (hso_net->parent); + +if (hso_net->net) { +unregister_netdev (hso_net->net); +free_netdev (hso_net->net); + } +/* start freeing */ for (i =0 ; i <MUX_BULK_RX_BUF_COUNT ; i++) {usb_free_urb (hso_net->mux_bulk_rx_urb_pool[i]);kfree (hso_net->mux_bulk_rx_buf_pool[i]); + hso_net->mux_bulk_rx_buf_pool[i] =NULL ; }usb_free_urb (hso_net->mux_bulk_tx_urb);kfree (hso_net->mux_bulk_tx_buf); - -remove_net_device (hso_net->parent);
From: Jan Dumon <[email protected]>
Date: Thu, 2 Apr 2009 10:57:20 +0200
Quoted 4 lines
Changed the order in which things are freed. This fixes an oops when unplugging the device while network traffic is ongoing.
Signed-off-by Jan Dumon <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html