Re: [PATCH] net: hso: fix module unloading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 24, 2017 at 09:18:39PM +0200, Andreas Kemnade wrote:
> keep tty driver until usb driver is unregistered
> rmmod hso
> produces traces like this without that:

Yeah, a blatant use-after-free.

> Signed-off-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>

Reviewed-by: Johan Hovold <johan@xxxxxxxxxx>

> ---
>  drivers/net/usb/hso.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
> index 2e66340..b75e23f 100644
> --- a/drivers/net/usb/hso.c
> +++ b/drivers/net/usb/hso.c
> @@ -3293,9 +3293,9 @@ static void __exit hso_exit(void)
>  	pr_info("unloaded\n");
>  
>  	tty_unregister_driver(tty_drv);
> -	put_tty_driver(tty_drv);
>  	/* deregister the usb driver */
>  	usb_deregister(&hso_driver);
> +	put_tty_driver(tty_drv);
>  }
>  
>  /* Module definitions */

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux