提交 1a5d76db 编写于 作者: P Peter Senna Tschudin 提交者: Greg Kroah-Hartman

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: NPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6b8fbde4
...@@ -1685,8 +1685,6 @@ EXPORT_SYMBOL_GPL(device_destroy); ...@@ -1685,8 +1685,6 @@ EXPORT_SYMBOL_GPL(device_destroy);
*/ */
int device_rename(struct device *dev, const char *new_name) 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; char *old_device_name = NULL;
int error; int error;
...@@ -1717,8 +1715,6 @@ int device_rename(struct device *dev, const char *new_name) ...@@ -1717,8 +1715,6 @@ int device_rename(struct device *dev, const char *new_name)
out: out:
put_device(dev); put_device(dev);
kfree(new_class_name);
kfree(old_class_name);
kfree(old_device_name); kfree(old_device_name);
return error; return error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册