From 66945cb744a5259446eb796a007121125c9e4701 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 6 Dec 2009 20:29:25 -0200 Subject: [PATCH] kfree is OK in case we haven't added the device. --- helloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helloc.c b/helloc.c index 4d99fcb..1a2c238 100644 --- a/helloc.c +++ b/helloc.c @@ -51,7 +51,7 @@ static int __init helloc_init(void) goto out_add; return 0; out_add: - kobject_put(&cdev->kobj); + kfree(&cdev->kobj); out_alloc: unregister_chrdev_region(dev, 1); out_region: -- 2.20.1