Loading drivers/char/diag/diag_usb.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -636,8 +636,8 @@ int diag_usb_register(int id, int ctxt, struct diag_mux_ops *ops) INIT_WORK(&(ch->read_done_work), usb_read_done_work_fn); INIT_WORK(&(ch->read_done_work), usb_read_done_work_fn); INIT_WORK(&(ch->connect_work), usb_connect_work_fn); INIT_WORK(&(ch->connect_work), usb_connect_work_fn); INIT_WORK(&(ch->disconnect_work), usb_disconnect_work_fn); INIT_WORK(&(ch->disconnect_work), usb_disconnect_work_fn); strlcpy(wq_name, "DIAG_USB_", DIAG_USB_STRING_SZ); strlcpy(wq_name, "DIAG_USB_", sizeof(wq_name)); strlcat(wq_name, ch->name, sizeof(ch->name)); strlcat(wq_name, ch->name, sizeof(wq_name)); ch->usb_wq = create_singlethread_workqueue(wq_name); ch->usb_wq = create_singlethread_workqueue(wq_name); if (!ch->usb_wq) if (!ch->usb_wq) goto err; goto err; Loading drivers/char/diag/diagchar_core.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4292,7 +4292,7 @@ static int __init diagchar_init(void) pr_debug("diagchar initializing ..\n"); pr_debug("diagchar initializing ..\n"); driver->num = 1; driver->num = 1; driver->name = ((void *)driver) + sizeof(struct diagchar_dev); driver->name = ((void *)driver) + sizeof(struct diagchar_dev); strlcpy(driver->name, "diag", 4); strlcpy(driver->name, "diag", 5); /* Get major number from kernel and initialize */ /* Get major number from kernel and initialize */ ret = alloc_chrdev_region(&dev, driver->minor_start, ret = alloc_chrdev_region(&dev, driver->minor_start, driver->num, driver->name); driver->num, driver->name); Loading drivers/char/diag/diagfwd_bridge.c +3 −3 Original line number Original line Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -176,8 +176,8 @@ int diagfwd_bridge_register(int id, int ctxt, struct diag_remote_dev_ops *ops) if (!ch->dci_read_buf) if (!ch->dci_read_buf) return -ENOMEM; return -ENOMEM; ch->dci_read_len = 0; ch->dci_read_len = 0; strlcpy(wq_name, "diag_dci_", 10); strlcpy(wq_name, "diag_dci_", sizeof(wq_name)); strlcat(wq_name, ch->name, sizeof(ch->name)); strlcat(wq_name, ch->name, sizeof(wq_name)); INIT_WORK(&(ch->dci_read_work), bridge_dci_read_work_fn); INIT_WORK(&(ch->dci_read_work), bridge_dci_read_work_fn); ch->dci_wq = create_singlethread_workqueue(wq_name); ch->dci_wq = create_singlethread_workqueue(wq_name); if (!ch->dci_wq) { if (!ch->dci_wq) { Loading drivers/char/diag/diagfwd_cntl.c +5 −3 Original line number Original line Diff line number Diff line Loading @@ -845,6 +845,7 @@ int diag_add_diag_id_to_list(uint8_t diag_id, char *process_name, uint8_t pd_val, uint8_t peripheral) uint8_t pd_val, uint8_t peripheral) { { struct diag_id_tbl_t *new_item = NULL; struct diag_id_tbl_t *new_item = NULL; int process_len = 0; if (!process_name || diag_id == 0) { if (!process_name || diag_id == 0) { DIAG_LOG(DIAG_DEBUG_PERIPHERALS, DIAG_LOG(DIAG_DEBUG_PERIPHERALS, Loading @@ -857,7 +858,8 @@ int diag_add_diag_id_to_list(uint8_t diag_id, char *process_name, if (!new_item) if (!new_item) return -ENOMEM; return -ENOMEM; kmemleak_not_leak(new_item); kmemleak_not_leak(new_item); new_item->process_name = kzalloc(strlen(process_name) + 1, GFP_KERNEL); process_len = strlen(process_name); new_item->process_name = kzalloc(process_len + 1, GFP_KERNEL); if (!new_item->process_name) { if (!new_item->process_name) { kfree(new_item); kfree(new_item); new_item = NULL; new_item = NULL; Loading @@ -867,7 +869,7 @@ int diag_add_diag_id_to_list(uint8_t diag_id, char *process_name, new_item->diag_id = diag_id; new_item->diag_id = diag_id; new_item->pd_val = pd_val; new_item->pd_val = pd_val; new_item->peripheral = peripheral; new_item->peripheral = peripheral; strlcpy(new_item->process_name, process_name, strlen(process_name) + 1); strlcpy(new_item->process_name, process_name, process_len + 1); INIT_LIST_HEAD(&new_item->link); INIT_LIST_HEAD(&new_item->link); mutex_lock(&driver->diag_id_mutex); mutex_lock(&driver->diag_id_mutex); list_add_tail(&new_item->link, &driver->diag_id_list); list_add_tail(&new_item->link, &driver->diag_id_list); Loading Loading @@ -969,7 +971,7 @@ static void process_diagid(uint8_t *buf, uint32_t len, ctrl_pkt.pkt_id = DIAG_CTRL_MSG_DIAGID; ctrl_pkt.pkt_id = DIAG_CTRL_MSG_DIAGID; ctrl_pkt.version = 1; ctrl_pkt.version = 1; strlcpy((char *)&ctrl_pkt.process_name, process_name, strlcpy((char *)&ctrl_pkt.process_name, process_name, strlen(process_name) + 1); sizeof(ctrl_pkt.process_name)); ctrl_pkt.len = sizeof(ctrl_pkt.diag_id) + sizeof(ctrl_pkt.version) + ctrl_pkt.len = sizeof(ctrl_pkt.diag_id) + sizeof(ctrl_pkt.version) + strlen(process_name) + 1; strlen(process_name) + 1; err = diagfwd_write(peripheral, TYPE_CNTL, &ctrl_pkt, ctrl_pkt.len + err = diagfwd_write(peripheral, TYPE_CNTL, &ctrl_pkt, ctrl_pkt.len + Loading drivers/char/diag/diagfwd_hsic.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -407,8 +407,8 @@ int diag_hsic_init(void) INIT_WORK(&(ch->read_work), hsic_read_work_fn); INIT_WORK(&(ch->read_work), hsic_read_work_fn); INIT_WORK(&(ch->open_work), hsic_open_work_fn); INIT_WORK(&(ch->open_work), hsic_open_work_fn); INIT_WORK(&(ch->close_work), hsic_close_work_fn); INIT_WORK(&(ch->close_work), hsic_close_work_fn); strlcpy(wq_name, "DIAG_HSIC_", DIAG_HSIC_STRING_SZ); strlcpy(wq_name, "DIAG_HSIC_", sizeof(wq_name)); strlcat(wq_name, ch->name, sizeof(ch->name)); strlcat(wq_name, ch->name, sizeof(wq_name)); ch->hsic_wq = create_singlethread_workqueue(wq_name); ch->hsic_wq = create_singlethread_workqueue(wq_name); if (!ch->hsic_wq) if (!ch->hsic_wq) goto fail; goto fail; Loading Loading
drivers/char/diag/diag_usb.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -636,8 +636,8 @@ int diag_usb_register(int id, int ctxt, struct diag_mux_ops *ops) INIT_WORK(&(ch->read_done_work), usb_read_done_work_fn); INIT_WORK(&(ch->read_done_work), usb_read_done_work_fn); INIT_WORK(&(ch->connect_work), usb_connect_work_fn); INIT_WORK(&(ch->connect_work), usb_connect_work_fn); INIT_WORK(&(ch->disconnect_work), usb_disconnect_work_fn); INIT_WORK(&(ch->disconnect_work), usb_disconnect_work_fn); strlcpy(wq_name, "DIAG_USB_", DIAG_USB_STRING_SZ); strlcpy(wq_name, "DIAG_USB_", sizeof(wq_name)); strlcat(wq_name, ch->name, sizeof(ch->name)); strlcat(wq_name, ch->name, sizeof(wq_name)); ch->usb_wq = create_singlethread_workqueue(wq_name); ch->usb_wq = create_singlethread_workqueue(wq_name); if (!ch->usb_wq) if (!ch->usb_wq) goto err; goto err; Loading
drivers/char/diag/diagchar_core.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -4292,7 +4292,7 @@ static int __init diagchar_init(void) pr_debug("diagchar initializing ..\n"); pr_debug("diagchar initializing ..\n"); driver->num = 1; driver->num = 1; driver->name = ((void *)driver) + sizeof(struct diagchar_dev); driver->name = ((void *)driver) + sizeof(struct diagchar_dev); strlcpy(driver->name, "diag", 4); strlcpy(driver->name, "diag", 5); /* Get major number from kernel and initialize */ /* Get major number from kernel and initialize */ ret = alloc_chrdev_region(&dev, driver->minor_start, ret = alloc_chrdev_region(&dev, driver->minor_start, driver->num, driver->name); driver->num, driver->name); Loading
drivers/char/diag/diagfwd_bridge.c +3 −3 Original line number Original line Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -176,8 +176,8 @@ int diagfwd_bridge_register(int id, int ctxt, struct diag_remote_dev_ops *ops) if (!ch->dci_read_buf) if (!ch->dci_read_buf) return -ENOMEM; return -ENOMEM; ch->dci_read_len = 0; ch->dci_read_len = 0; strlcpy(wq_name, "diag_dci_", 10); strlcpy(wq_name, "diag_dci_", sizeof(wq_name)); strlcat(wq_name, ch->name, sizeof(ch->name)); strlcat(wq_name, ch->name, sizeof(wq_name)); INIT_WORK(&(ch->dci_read_work), bridge_dci_read_work_fn); INIT_WORK(&(ch->dci_read_work), bridge_dci_read_work_fn); ch->dci_wq = create_singlethread_workqueue(wq_name); ch->dci_wq = create_singlethread_workqueue(wq_name); if (!ch->dci_wq) { if (!ch->dci_wq) { Loading
drivers/char/diag/diagfwd_cntl.c +5 −3 Original line number Original line Diff line number Diff line Loading @@ -845,6 +845,7 @@ int diag_add_diag_id_to_list(uint8_t diag_id, char *process_name, uint8_t pd_val, uint8_t peripheral) uint8_t pd_val, uint8_t peripheral) { { struct diag_id_tbl_t *new_item = NULL; struct diag_id_tbl_t *new_item = NULL; int process_len = 0; if (!process_name || diag_id == 0) { if (!process_name || diag_id == 0) { DIAG_LOG(DIAG_DEBUG_PERIPHERALS, DIAG_LOG(DIAG_DEBUG_PERIPHERALS, Loading @@ -857,7 +858,8 @@ int diag_add_diag_id_to_list(uint8_t diag_id, char *process_name, if (!new_item) if (!new_item) return -ENOMEM; return -ENOMEM; kmemleak_not_leak(new_item); kmemleak_not_leak(new_item); new_item->process_name = kzalloc(strlen(process_name) + 1, GFP_KERNEL); process_len = strlen(process_name); new_item->process_name = kzalloc(process_len + 1, GFP_KERNEL); if (!new_item->process_name) { if (!new_item->process_name) { kfree(new_item); kfree(new_item); new_item = NULL; new_item = NULL; Loading @@ -867,7 +869,7 @@ int diag_add_diag_id_to_list(uint8_t diag_id, char *process_name, new_item->diag_id = diag_id; new_item->diag_id = diag_id; new_item->pd_val = pd_val; new_item->pd_val = pd_val; new_item->peripheral = peripheral; new_item->peripheral = peripheral; strlcpy(new_item->process_name, process_name, strlen(process_name) + 1); strlcpy(new_item->process_name, process_name, process_len + 1); INIT_LIST_HEAD(&new_item->link); INIT_LIST_HEAD(&new_item->link); mutex_lock(&driver->diag_id_mutex); mutex_lock(&driver->diag_id_mutex); list_add_tail(&new_item->link, &driver->diag_id_list); list_add_tail(&new_item->link, &driver->diag_id_list); Loading Loading @@ -969,7 +971,7 @@ static void process_diagid(uint8_t *buf, uint32_t len, ctrl_pkt.pkt_id = DIAG_CTRL_MSG_DIAGID; ctrl_pkt.pkt_id = DIAG_CTRL_MSG_DIAGID; ctrl_pkt.version = 1; ctrl_pkt.version = 1; strlcpy((char *)&ctrl_pkt.process_name, process_name, strlcpy((char *)&ctrl_pkt.process_name, process_name, strlen(process_name) + 1); sizeof(ctrl_pkt.process_name)); ctrl_pkt.len = sizeof(ctrl_pkt.diag_id) + sizeof(ctrl_pkt.version) + ctrl_pkt.len = sizeof(ctrl_pkt.diag_id) + sizeof(ctrl_pkt.version) + strlen(process_name) + 1; strlen(process_name) + 1; err = diagfwd_write(peripheral, TYPE_CNTL, &ctrl_pkt, ctrl_pkt.len + err = diagfwd_write(peripheral, TYPE_CNTL, &ctrl_pkt, ctrl_pkt.len + Loading
drivers/char/diag/diagfwd_hsic.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -407,8 +407,8 @@ int diag_hsic_init(void) INIT_WORK(&(ch->read_work), hsic_read_work_fn); INIT_WORK(&(ch->read_work), hsic_read_work_fn); INIT_WORK(&(ch->open_work), hsic_open_work_fn); INIT_WORK(&(ch->open_work), hsic_open_work_fn); INIT_WORK(&(ch->close_work), hsic_close_work_fn); INIT_WORK(&(ch->close_work), hsic_close_work_fn); strlcpy(wq_name, "DIAG_HSIC_", DIAG_HSIC_STRING_SZ); strlcpy(wq_name, "DIAG_HSIC_", sizeof(wq_name)); strlcat(wq_name, ch->name, sizeof(ch->name)); strlcat(wq_name, ch->name, sizeof(wq_name)); ch->hsic_wq = create_singlethread_workqueue(wq_name); ch->hsic_wq = create_singlethread_workqueue(wq_name); if (!ch->hsic_wq) if (!ch->hsic_wq) goto fail; goto fail; Loading