diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2012-12-08 12:38:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 15:57:06 -0500 |
commit | 1a5d76dbe825fa6deba3d8979bbd334ea17b6dcc (patch) | |
tree | c9536774f9bd2c3ebb81467b090f46e6185ac52a | |
parent | 6b8fbde41866306fa910754a59671b27aa5cfd37 (diff) |
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@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/base/core.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index a235085e343c..27603a6c0a93 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -1685,8 +1685,6 @@ EXPORT_SYMBOL_GPL(device_destroy); | |||
1685 | */ | 1685 | */ |
1686 | int device_rename(struct device *dev, const char *new_name) | 1686 | int device_rename(struct device *dev, const char *new_name) |
1687 | { | 1687 | { |
1688 | char *old_class_name = NULL; | ||
1689 | char *new_class_name = NULL; | ||
1690 | char *old_device_name = NULL; | 1688 | char *old_device_name = NULL; |
1691 | int error; | 1689 | int error; |
1692 | 1690 | ||
@@ -1717,8 +1715,6 @@ int device_rename(struct device *dev, const char *new_name) | |||
1717 | out: | 1715 | out: |
1718 | put_device(dev); | 1716 | put_device(dev); |
1719 | 1717 | ||
1720 | kfree(new_class_name); | ||
1721 | kfree(old_class_name); | ||
1722 | kfree(old_device_name); | 1718 | kfree(old_device_name); |
1723 | 1719 | ||
1724 | return error; | 1720 | return error; |