aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/uinput.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/uinput.c')
-rw-r--r--drivers/input/misc/uinput.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 4015a91f4b6e..948c1cc01bc9 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -271,8 +271,7 @@ static int uinput_alloc_device(struct file *file, const char __user *buffer, siz
271 goto exit; 271 goto exit;
272 } 272 }
273 273
274 if (dev->name) 274 kfree(dev->name);
275 kfree(dev->name);
276 275
277 size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1; 276 size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;
278 dev->name = name = kmalloc(size, GFP_KERNEL); 277 dev->name = name = kmalloc(size, GFP_KERNEL);
@@ -372,11 +371,8 @@ static int uinput_burn_device(struct uinput_device *udev)
372 if (test_bit(UIST_CREATED, &udev->state)) 371 if (test_bit(UIST_CREATED, &udev->state))
373 uinput_destroy_device(udev); 372 uinput_destroy_device(udev);
374 373
375 if (udev->dev->name) 374 kfree(udev->dev->name);
376 kfree(udev->dev->name); 375 kfree(udev->dev->phys);
377 if (udev->dev->phys)
378 kfree(udev->dev->phys);
379
380 kfree(udev->dev); 376 kfree(udev->dev);
381 kfree(udev); 377 kfree(udev);
382 378