Re: [PATCH v3] usb: typec: fix bug in typec_register_port call

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

 



On Fri, Mar 15, 2019 at 03:43:21PM -0700, anil.kumar.k@xxxxxxxxx wrote:
> From: Anil Kumar <anil.kumar.k@xxxxxxxxx>
> 
> typec_register_port function used variable port->id without
> initializing it. This patch fixes the issue by using the local
> instance for the error case
> 
> Issue is not observed in the mainline tree (5.x)
> 
> Signed-off-by: Anil Kumar <anil.kumar.k@xxxxxxxxx>
> Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers")
> Cc: stable@xxxxxxxxxxxxxxx #4.19.x

You have the tag, but I don't see stable@xxxxxxxxxxxxxxx on your CC
line? I'm adding it there now. The patch is otherwise OK.

Acked-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>

> ---
>  drivers/usb/typec/class.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index e61dffb..5a442e4 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -1611,7 +1611,7 @@ struct typec_port *typec_register_port(struct device *parent,
>  	typec_switch_put(port->sw);
>  
>  err_switch:
> -	ida_simple_remove(&typec_index_ida, port->id);
> +	ida_simple_remove(&typec_index_ida, id);
>  	kfree(port);
>  
>  	return ERR_PTR(ret);
> -- 
> 2.7.4

thanks,

-- 
heikki



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux