Re: [PATCH -next] usb: typec: altmodes: Fix missing unlock on error in dp_altmode_activate()

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

 



On Wed, Jul 04, 2018 at 09:25:43AM +0000, Wei Yongjun wrote:
> Add the missing unlock before return from function
> dp_altmode_activate() in the error handling case.
> 
> Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode")
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> ---
>  drivers/usb/typec/altmodes/displayport.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index ef12b15..83e3a38 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -349,8 +349,10 @@ static int dp_altmode_activate(struct typec_altmode *alt, int activate)
>  	cap = DP_CAP_CAPABILITY(dp->alt->vdo);
>  
>  	if ((con == DP_CONF_DFP_D && !(cap & DP_CAP_DFP_D)) ||
> -	    (con == DP_CONF_UFP_D && !(cap & DP_CAP_UFP_D)))
> -		return -EINVAL;
> +	    (con == DP_CONF_UFP_D && !(cap & DP_CAP_UFP_D))) {
> +		ret = -EINVAL;
> +		goto err_unlock;
> +	}
>  
>  	conf = dp->data.conf & ~DP_CONF_DUAL_D;
>  	conf |= con;

Thank you for the patch. Colin King found the same issue, and his
patch is also fixing some other issue with this function, so let's use
that instead.


Br,

-- 
heikki
--
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