[PATCH] kfree cleanup: misc remaining drivers

This is the remaining misc drivers/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in misc files in
drivers/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Len Brown <len.brown@intel.com>
Acked-by: "Antonino A. Daplas" <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jesper Juhl
2005-11-07 01:01:32 -08:00
committed by Linus Torvalds
parent 2ea7533060
commit 6044ec8882
24 changed files with 83 additions and 151 deletions

View File

@ -271,8 +271,7 @@ static int uinput_alloc_device(struct file *file, const char __user *buffer, siz
goto exit;
}
if (dev->name)
kfree(dev->name);
kfree(dev->name);
size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;
dev->name = name = kmalloc(size, GFP_KERNEL);
@ -372,11 +371,8 @@ static int uinput_burn_device(struct uinput_device *udev)
if (test_bit(UIST_CREATED, &udev->state))
uinput_destroy_device(udev);
if (udev->dev->name)
kfree(udev->dev->name);
if (udev->dev->phys)
kfree(udev->dev->phys);
kfree(udev->dev->name);
kfree(udev->dev->phys);
kfree(udev->dev);
kfree(udev);