if (dev->name) kfree(dev->name); 
kfree(dev->name); 
static int uinput_alloc_device(struct file *file, const char __user *buffer, size_t count){	struct uinput_user_dev	*user_dev;	struct input_dev	*dev;	struct uinput_device	*udev;	char			*name;	int			size;	int			retval;	retval = count;	udev = file->private_data;	dev = udev->dev;	user_dev = kmalloc(sizeof(struct uinput_user_dev), GFP_KERNEL);	if (!user_dev) {		retval = -ENOMEM;		goto exit;	}	if (copy_from_user(user_dev, buffer, sizeof(struct uinput_user_dev))) {		retval = -EFAULT;		goto exit;	}	if (dev->name)		kfree(dev->name);	size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE) + 1;	dev->name = name = kmalloc(size, GFP_KERNEL);	if (!name) {		retval = -ENOMEM;		goto exit;	}	strlcpy(name, user_dev->name, size);	dev->id.bustype	= user_dev->id.bustype;	dev->id.vendor	= user_dev->id.vendor;	dev->id.product	= user_dev->id.product;	dev->id.version	= user_dev->id.version;	dev->ff_effects_max = user_dev->ff_effects_max;	size = sizeof(int) * (ABS_MAX + 1);	memcpy(dev->absmax, user_dev->absmax, size);	memcpy(dev->absmin, user_dev->absmin, size);	memcpy(dev->absfuzz, user_dev->absfuzz, size);	memcpy(dev->absflat, user_dev->absflat, size);	/* check if absmin/absmax/absfuzz/absflat are filled as	 * told in Documentation/input/input-programming.txt */	if (test_bit(EV_ABS, dev->evbit)) {		int err = uinput_validate_absbits(dev);		if (err < 0) {			retval = err;			kfree(dev->name);		}	}exit:	kfree(user_dev);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6044ec8882c726e325017bd948aa0cd94ad33abc/uinput.c/clean/drivers/input/misc/uinput.c