Loading drivers/usb/gadget/function/f_diag.c +18 −5 Original line number Diff line number Diff line Loading @@ -386,9 +386,11 @@ struct usb_diag_ch *usb_diag_open(const char *name, void *priv, ch->priv = priv; ch->notify = notify; if (!found) { spin_lock_irqsave(&ch_lock, flags); list_add_tail(&ch->list, &usb_diag_ch_list); spin_unlock_irqrestore(&ch_lock, flags); } return ch; } Loading Loading @@ -863,6 +865,7 @@ static struct diag_context *diag_context_init(const char *name) struct diag_context *dev; struct usb_diag_ch *_ch; int found = 0; unsigned long flags; pr_debug("%s\n", __func__); Loading @@ -872,9 +875,19 @@ static struct diag_context *diag_context_init(const char *name) break; } } if (!found) { pr_err("%s: unable to get diag usb channel\n", __func__); return ERR_PTR(-ENODEV); pr_warn("%s: unable to get diag usb channel\n", __func__); _ch = kzalloc(sizeof(*_ch), GFP_KERNEL); if (_ch == NULL) return ERR_PTR(-ENOMEM); _ch->name = name; spin_lock_irqsave(&ch_lock, flags); list_add_tail(&_ch->list, &usb_diag_ch_list); spin_unlock_irqrestore(&ch_lock, flags); } dev = kzalloc(sizeof(*dev), GFP_KERNEL); Loading Loading
drivers/usb/gadget/function/f_diag.c +18 −5 Original line number Diff line number Diff line Loading @@ -386,9 +386,11 @@ struct usb_diag_ch *usb_diag_open(const char *name, void *priv, ch->priv = priv; ch->notify = notify; if (!found) { spin_lock_irqsave(&ch_lock, flags); list_add_tail(&ch->list, &usb_diag_ch_list); spin_unlock_irqrestore(&ch_lock, flags); } return ch; } Loading Loading @@ -863,6 +865,7 @@ static struct diag_context *diag_context_init(const char *name) struct diag_context *dev; struct usb_diag_ch *_ch; int found = 0; unsigned long flags; pr_debug("%s\n", __func__); Loading @@ -872,9 +875,19 @@ static struct diag_context *diag_context_init(const char *name) break; } } if (!found) { pr_err("%s: unable to get diag usb channel\n", __func__); return ERR_PTR(-ENODEV); pr_warn("%s: unable to get diag usb channel\n", __func__); _ch = kzalloc(sizeof(*_ch), GFP_KERNEL); if (_ch == NULL) return ERR_PTR(-ENOMEM); _ch->name = name; spin_lock_irqsave(&ch_lock, flags); list_add_tail(&_ch->list, &usb_diag_ch_list); spin_unlock_irqrestore(&ch_lock, flags); } dev = kzalloc(sizeof(*dev), GFP_KERNEL); Loading