summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/bus/cosm_bus.c
diff options
context:
space:
mode:
authorGeliang Tang2015-10-12 06:05:13 +0200
committerGreg Kroah-Hartman2015-10-18 06:42:29 +0200
commit82ff3ac7641a645b55f3bee4acceabf6f17e62f4 (patch)
tree4c132acad29c0ceb736b20051ec170097e7c984e /drivers/misc/mic/bus/cosm_bus.c
parentmisc: mic: Fix randconfig build error (diff)
downloadkernel-qcow2-linux-82ff3ac7641a645b55f3bee4acceabf6f17e62f4.tar.gz
kernel-qcow2-linux-82ff3ac7641a645b55f3bee4acceabf6f17e62f4.tar.xz
kernel-qcow2-linux-82ff3ac7641a645b55f3bee4acceabf6f17e62f4.zip
misc: mic: replace kfree with put_device
Handle a failed device_register(), replace kfree() with put_device(), which will call cosm/mbus/scif_release_dev(). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/bus/cosm_bus.c')
-rw-r--r--drivers/misc/mic/bus/cosm_bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mic/bus/cosm_bus.c b/drivers/misc/mic/bus/cosm_bus.c
index 1e36830f1a4e..d31d6c6e6cb1 100644
--- a/drivers/misc/mic/bus/cosm_bus.c
+++ b/drivers/misc/mic/bus/cosm_bus.c
@@ -100,7 +100,7 @@ cosm_register_device(struct device *pdev, struct cosm_hw_ops *hw_ops)
ida_remove:
ida_simple_remove(&cosm_index_ida, cdev->index);
free_cdev:
- kfree(cdev);
+ put_device(&cdev->dev);
return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(cosm_register_device);