Re: [PATCH] usb: misc: chaoskey: remove useless else

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

 



Salah Triki <salah.triki@xxxxxxxxx> writes:

> Remove useless else in order to make the code cleaner.

> -	if (!dev->present) {
> -		if (dev->open == 0) {
> -			mutex_unlock(&dev->lock);
> +	mutex_unlock(&dev->lock);
> +
> +	if (!dev->present)
> +		if (dev->open == 0)
>  			chaoskey_free(dev);
> -		} else
> -			mutex_unlock(&dev->lock);
> -	} else
> -		mutex_unlock(&dev->lock);

This accesses dev->present outside of the lock region introducing a
potential race condition.

-- 
-keith

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux