Loading drivers/usb/gadget/function/f_serial.c +10 −5 Original line number Diff line number Diff line Loading @@ -1111,17 +1111,22 @@ static struct usb_function *gser_alloc(struct usb_function_instance *fi) struct f_gser *gser; struct f_serial_opts *opts; opts = container_of(fi, struct f_serial_opts, func_inst); if (nr_ports) { opts->port_num = gser_next_free_port++; if (opts->port_num >= GSERIAL_NO_PORTS) { pr_err("%s: No serial allowed for port %d\n", __func__, opts->port_num); return ERR_PTR(-EINVAL); } } /* allocate and initialize one new instance */ gser = kzalloc(sizeof(*gser), GFP_KERNEL); if (!gser) return ERR_PTR(-ENOMEM); opts = container_of(fi, struct f_serial_opts, func_inst); spin_lock_init(&gser->lock); if (nr_ports) opts->port_num = gser_next_free_port++; gser->port_num = opts->port_num; gser->port.func.name = "gser"; Loading Loading
drivers/usb/gadget/function/f_serial.c +10 −5 Original line number Diff line number Diff line Loading @@ -1111,17 +1111,22 @@ static struct usb_function *gser_alloc(struct usb_function_instance *fi) struct f_gser *gser; struct f_serial_opts *opts; opts = container_of(fi, struct f_serial_opts, func_inst); if (nr_ports) { opts->port_num = gser_next_free_port++; if (opts->port_num >= GSERIAL_NO_PORTS) { pr_err("%s: No serial allowed for port %d\n", __func__, opts->port_num); return ERR_PTR(-EINVAL); } } /* allocate and initialize one new instance */ gser = kzalloc(sizeof(*gser), GFP_KERNEL); if (!gser) return ERR_PTR(-ENOMEM); opts = container_of(fi, struct f_serial_opts, func_inst); spin_lock_init(&gser->lock); if (nr_ports) opts->port_num = gser_next_free_port++; gser->port_num = opts->port_num; gser->port.func.name = "gser"; Loading