Revert "usbtmc: convert to devm_kzalloc"
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2016 09:48:44 +0000 (11:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:03:20 +0000 (15:03 +0200)
commitec370e27f4e910fbaa21c5a1f73e5dd9771c2fc0
treef08f6e86ab3a44895b8476569d3116b073371dd4
parent6bd1000a333d9ec19e4866e15b2f441d2e35134d
Revert "usbtmc: convert to devm_kzalloc"

commit ab21b63e8aedfc73565dd9cdd51eb338341177cb upstream.

This reverts commit e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b.

Turns out it was totally wrong.  The memory is supposed to be bound to
the kref, as the original code was doing correctly, not the
device/driver binding as the devm_kzalloc() would cause.

This fixes an oops when read would be called after the device was
unbound from the driver.

Reported-by: Ladislav Michl <ladis@linux-mips.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/usbtmc.c
This page took 0.024023 seconds and 5 git commands to generate.