Commit e6c7efdc authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

usbtmc: convert to devm_kzalloc

kfree(data) will be called implicitly.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bbf4976e
...@@ -121,7 +121,6 @@ static void usbtmc_delete(struct kref *kref) ...@@ -121,7 +121,6 @@ static void usbtmc_delete(struct kref *kref)
struct usbtmc_device_data *data = to_usbtmc_data(kref); struct usbtmc_device_data *data = to_usbtmc_data(kref);
usb_put_dev(data->usb_dev); usb_put_dev(data->usb_dev);
kfree(data);
} }
static int usbtmc_open(struct inode *inode, struct file *filp) static int usbtmc_open(struct inode *inode, struct file *filp)
...@@ -1101,7 +1100,7 @@ static int usbtmc_probe(struct usb_interface *intf, ...@@ -1101,7 +1100,7 @@ static int usbtmc_probe(struct usb_interface *intf,
dev_dbg(&intf->dev, "%s called\n", __func__); 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) { if (!data) {
dev_err(&intf->dev, "Unable to allocate kernel memory\n"); dev_err(&intf->dev, "Unable to allocate kernel memory\n");
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment