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