Re: [PATCH v3 1/9] usb: typec: Copy everything from struct typec_capability during registration

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

 



On Tue, Oct 08, 2019 at 01:44:28PM -0700, Guenter Roeck wrote:
> > @@ -1579,9 +1581,10 @@ struct typec_port *typec_register_port(struct device *parent,
> >  	mutex_init(&port->port_type_lock);
> >  
> >  	port->id = id;
> > -	port->cap = cap;
> > +	port->orig_cap = cap;
> >  	port->port_type = cap->type;
> >  	port->prefer_role = cap->prefer_role;
> > +	port->cap = kmemdup(cap, sizeof(*cap), GFP_KERNEL);
> 
> I just realized ... unfortunately kmemdup() can return NULL.

Of course. I'll fix that.

thanks,

-- 
heikki



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

  Powered by Linux