Fix releasing cdev when if registering fails.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 8 Dec 2009 09:04:03 +0000 (07:04 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 8 Dec 2009 09:04:03 +0000 (07:04 -0200)
helloc.c

index 1a2c238..0a7cf40 100644 (file)
--- a/helloc.c
+++ b/helloc.c
@@ -51,7 +51,7 @@ static int __init helloc_init(void)
                goto out_add;
        return 0;
 out_add:
-       kfree(&cdev->kobj);
+       kfree(cdev);
 out_alloc:
        unregister_chrdev_region(dev, 1);
 out_region: