diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-07-15 11:59:41 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 12:01:12 -0700 |
commit | e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b (patch) | |
tree | 7a2eae3dbabbd3dacc611603452ea32f61535541 | |
parent | bbf4976e7715da4a3e3599a500eb20d6be8b5046 (diff) | |
download | kernel_goldelico_gta04-e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b.zip kernel_goldelico_gta04-e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b.tar.gz kernel_goldelico_gta04-e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b.tar.bz2 |
usbtmc: convert to devm_kzalloc
kfree(data) will be called implicitly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/class/usbtmc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index d683f90..60dd891 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -121,7 +121,6 @@ static void usbtmc_delete(struct kref *kref) struct usbtmc_device_data *data = to_usbtmc_data(kref); usb_put_dev(data->usb_dev); - kfree(data); } static int usbtmc_open(struct inode *inode, struct file *filp) @@ -1101,7 +1100,7 @@ static int usbtmc_probe(struct usb_interface *intf, dev_dbg(&intf->dev, "%s called\n", __func__); - data = kmalloc(sizeof(struct usbtmc_device_data), GFP_KERNEL); + data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL); if (!data) { dev_err(&intf->dev, "Unable to allocate kernel memory\n"); return -ENOMEM; |