[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1354988286-2303-1-git-send-email-peter.senna@gmail.com>
Date: Sat, 8 Dec 2012 15:38:06 -0200
From: Peter Senna Tschudin <peter.senna@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Peter Senna Tschudin <peter.senna@...il.com>
Subject: [PATCH V2] drivers/base/core.c: Remove two unused variables and two useless calls to kfree
old_class_name, and new_class_name are never used. This patch remove the
declaration and calls to kfree.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r1 forall@
type T; identifier i;
@@
* T *i = NULL;
... when != i
* kfree(i);
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@...il.com>
---
Changes from V1: Added drivers/base/core.c: to subject
drivers/base/core.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index a235085..27603a6 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1685,8 +1685,6 @@ EXPORT_SYMBOL_GPL(device_destroy);
*/
int device_rename(struct device *dev, const char *new_name)
{
- char *old_class_name = NULL;
- char *new_class_name = NULL;
char *old_device_name = NULL;
int error;
@@ -1717,8 +1715,6 @@ int device_rename(struct device *dev, const char *new_name)
out:
put_device(dev);
- kfree(new_class_name);
- kfree(old_class_name);
kfree(old_device_name);
return error;
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists