Thread (6 messages) flat view 6 messages, 5 authors, 2012-09-13

RE: [PATCH 9/9] drivers/isdn/gigaset/common.c: Remove useless kfree

From: David Laight <hidden>
Date: 2012-09-13 08:38:07
Also in: kernel-janitors, lkml

Remove useless kfree() and clean up code related to the removal.
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index aa41485..30a6b17 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -1123,7 +1123,6 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
 	return drv;

 error:
-	kfree(drv->cs);
 	kfree(drv);
 	return NULL;
 }
Seems to me that (assuming kfree(NULL) is ok) the kfree()
is best left in - just in case some other error path is
added after drv->cs is assigned.
Better safe than a memory leak.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help