Re: [PATCH] Input: uinput - unlock on allocation failure in ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 08, 2017 at 11:39:46AM +0300, Dan Carpenter wrote:
> We have to unlock before returning if input_allocate_device() fails.
> 
> Fixes: 04ce40a61a91 ("Input: uinput - remove uinput_allocate_device()")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Applied, thank you.


> 
> diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
> index 7b41aad7ec27..39ddd9a73feb 100644
> --- a/drivers/input/misc/uinput.c
> +++ b/drivers/input/misc/uinput.c
> @@ -857,8 +857,10 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
>  
>  	if (!udev->dev) {
>  		udev->dev = input_allocate_device();
> -		if (!udev->dev)
> -			return -ENOMEM;
> +		if (!udev->dev) {
> +			retval = -ENOMEM;
> +			goto out;
> +		}
>  	}
>  
>  	switch (cmd) {

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux