]> git.baikalelectronics.ru Git - kernel.git/commit
at76c50x-usb: fix use after free on failure path in at76_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Thu, 14 Aug 2014 23:00:06 +0000 (03:00 +0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 25 Aug 2014 19:39:23 +0000 (15:39 -0400)
commitc5a10467618420ec63c7f915aa109eb906c97c11
tree622e9576448d921bca82e4ad7f275df647be0750
parentb4bb9c4fba110c867ad02d67fa993e20574fb04d
at76c50x-usb: fix use after free on failure path in at76_probe()

After commit c4092b604a88 ("at76c50x-usb: Don't perform DMA from stack memory")
at76_delete_device() and usb_put_dev() are called both
if at76_init_new_device() fails in at76_probe().
But at76_delete_device() does usb_put_dev(priv->dev) itself
that means double usb_put_dev().

The patch avoids the problem by moving usb_put_dev() from
at76_delete_device() to at76_disconnect().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/at76c50x-usb.c