Loading drivers/char/diag/diag_masks.c +13 −7 Original line number Diff line number Diff line Loading @@ -909,11 +909,13 @@ static int diag_cmd_set_all_msg_mask(unsigned char *src_buf, int src_len, mask_info->status = (req->rt_mask) ? DIAG_CTRL_MASK_ALL_ENABLED : DIAG_CTRL_MASK_ALL_DISABLED; for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++) { if (mask && mask->ptr) { mutex_lock(&mask->lock); memset(mask->ptr, req->rt_mask, mask->range * sizeof(uint32_t)); mutex_unlock(&mask->lock); } } mutex_unlock(&driver->msg_mask_lock); mutex_unlock(&mask_info->lock); mutex_unlock(&driver->md_session_lock); Loading Loading @@ -1311,6 +1313,8 @@ static int diag_cmd_set_log_mask(unsigned char *src_buf, int src_len, mutex_lock(&mask_info->lock); for (i = 0; i < MAX_EQUIP_ID && !status; i++, mask++) { if (!mask || !mask->ptr) continue; if (mask->equip_id != req->equip_id) continue; mutex_lock(&mask->lock); Loading Loading @@ -1432,10 +1436,12 @@ static int diag_cmd_disable_log_mask(unsigned char *src_buf, int src_len, return -EINVAL; } for (i = 0; i < MAX_EQUIP_ID; i++, mask++) { if (mask && mask->ptr) { mutex_lock(&mask->lock); memset(mask->ptr, 0, mask->range); mutex_unlock(&mask->lock); } } mask_info->status = DIAG_CTRL_MASK_ALL_DISABLED; mutex_unlock(&driver->md_session_lock); if (diag_check_update(APPS_DATA)) Loading drivers/char/diag/diagfwd_cntl.c +21 −4 Original line number Diff line number Diff line /* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. * * 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 Loading Loading @@ -443,8 +443,8 @@ static void process_last_event_report(uint8_t *buf, uint32_t len, header = (struct diag_ctrl_last_event_report *)ptr; event_size = ((header->event_last_id / 8) + 1); if (event_size >= driver->event_mask_size) { pr_debug("diag: In %s, receiving event mask size more that Apps can handle\n", __func__); DIAG_LOG(DIAG_DEBUG_MASKS, "diag: receiving event mask size more that Apps can handle\n"); temp = krealloc(driver->event_mask->ptr, event_size, GFP_KERNEL); if (!temp) { Loading Loading @@ -558,6 +558,10 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len, mask_ptr = (struct diag_msg_mask_t *)msg_mask.ptr; found = 0; for (j = 0; j < driver->msg_mask_tbl_count; j++, mask_ptr++) { if (!mask_ptr || !ssid_range) { found = 1; break; } if (mask_ptr->ssid_first != ssid_range->ssid_first) continue; mutex_lock(&mask_ptr->lock); Loading @@ -576,6 +580,8 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len, new_size = (driver->msg_mask_tbl_count + 1) * sizeof(struct diag_msg_mask_t); DIAG_LOG(DIAG_DEBUG_MASKS, "diag: receiving msg mask size more that Apps can handle\n"); temp = krealloc(msg_mask.ptr, new_size, GFP_KERNEL); if (!temp) { pr_err("diag: In %s, Unable to add new ssid table to msg mask, ssid first: %d, last: %d\n", Loading @@ -584,6 +590,7 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len, continue; } msg_mask.ptr = temp; mask_ptr = (struct diag_msg_mask_t *)msg_mask.ptr; err = diag_create_msg_mask_table_entry(mask_ptr, ssid_range); if (err) { pr_err("diag: In %s, Unable to create a new msg mask table entry, first: %d last: %d err: %d\n", Loading Loading @@ -623,6 +630,10 @@ static void diag_build_time_mask_update(uint8_t *buf, num_items = range->ssid_last - range->ssid_first + 1; for (i = 0; i < driver->bt_msg_mask_tbl_count; i++, build_mask++) { if (!build_mask) { found = 1; break; } if (build_mask->ssid_first != range->ssid_first) continue; found = 1; Loading @@ -633,7 +644,8 @@ static void diag_build_time_mask_update(uint8_t *buf, __func__); } dest_ptr = build_mask->ptr; for (j = 0; j < build_mask->range; j++, mask_ptr++, dest_ptr++) for (j = 0; (j < build_mask->range) && mask_ptr && dest_ptr; j++, mask_ptr++, dest_ptr++) *(uint32_t *)dest_ptr |= *mask_ptr; mutex_unlock(&build_mask->lock); break; Loading @@ -641,8 +653,12 @@ static void diag_build_time_mask_update(uint8_t *buf, if (found) goto end; new_size = (driver->bt_msg_mask_tbl_count + 1) * sizeof(struct diag_msg_mask_t); DIAG_LOG(DIAG_DEBUG_MASKS, "diag: receiving build time mask size more that Apps can handle\n"); temp = krealloc(driver->build_time_mask->ptr, new_size, GFP_KERNEL); if (!temp) { pr_err("diag: In %s, unable to create a new entry for build time mask\n", Loading @@ -650,6 +666,7 @@ static void diag_build_time_mask_update(uint8_t *buf, goto end; } driver->build_time_mask->ptr = temp; build_mask = (struct diag_msg_mask_t *)driver->build_time_mask->ptr; err = diag_create_msg_mask_table_entry(build_mask, range); if (err) { pr_err("diag: In %s, Unable to create a new msg mask table entry, err: %d\n", Loading drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_fw_update.c +3 −1 Original line number Diff line number Diff line Loading @@ -681,10 +681,12 @@ static enum flash_area fwu_go_nogo(struct image_header_data *header) goto exit; } while (strptr[index] >= '0' && strptr[index] <= '9') { while ((index < MAX_FIRMWARE_ID_LEN - 1) && strptr[index] >= '0' && strptr[index] <= '9') { firmware_id[index] = strptr[index]; index++; } firmware_id[index] = '\0'; retval = sstrtoul(firmware_id, 10, &image_fw_id); kfree(firmware_id); Loading drivers/misc/qseecom.c +5 −6 Original line number Diff line number Diff line /*Qualcomm Secure Execution Environment Communicator (QSEECOM) driver * * 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 * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -8783,6 +8783,7 @@ exit_unreg_chrdev_region: static int qseecom_remove(struct platform_device *pdev) { struct qseecom_registered_kclient_list *kclient = NULL; struct qseecom_registered_kclient_list *kclient_tmp = NULL; unsigned long flags = 0; int ret = 0; int i; Loading @@ -8792,10 +8793,8 @@ static int qseecom_remove(struct platform_device *pdev) atomic_set(&qseecom.qseecom_state, QSEECOM_STATE_NOT_READY); spin_lock_irqsave(&qseecom.registered_kclient_list_lock, flags); list_for_each_entry(kclient, &qseecom.registered_kclient_list_head, list) { if (!kclient) goto exit_irqrestore; list_for_each_entry_safe(kclient, kclient_tmp, &qseecom.registered_kclient_list_head, list) { /* Break the loop if client handle is NULL */ if (!kclient->handle) Loading @@ -8819,7 +8818,7 @@ exit_free_kc_handle: kzfree(kclient->handle); exit_free_kclient: kzfree(kclient); exit_irqrestore: spin_unlock_irqrestore(&qseecom.registered_kclient_list_lock, flags); if (qseecom.qseos_version > QSEEE_VERSION_00) Loading drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c +2 −0 Original line number Diff line number Diff line Loading @@ -1432,6 +1432,8 @@ static int ipa_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /* Extended IOCTLs */ case RMNET_IOCTL_EXTENDED: if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) return -EPERM; IPAWANDBG("get ioctl: RMNET_IOCTL_EXTENDED\n"); if (copy_from_user(&extend_ioctl_data, (u8 *)ifr->ifr_ifru.ifru_data, Loading Loading
drivers/char/diag/diag_masks.c +13 −7 Original line number Diff line number Diff line Loading @@ -909,11 +909,13 @@ static int diag_cmd_set_all_msg_mask(unsigned char *src_buf, int src_len, mask_info->status = (req->rt_mask) ? DIAG_CTRL_MASK_ALL_ENABLED : DIAG_CTRL_MASK_ALL_DISABLED; for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++) { if (mask && mask->ptr) { mutex_lock(&mask->lock); memset(mask->ptr, req->rt_mask, mask->range * sizeof(uint32_t)); mutex_unlock(&mask->lock); } } mutex_unlock(&driver->msg_mask_lock); mutex_unlock(&mask_info->lock); mutex_unlock(&driver->md_session_lock); Loading Loading @@ -1311,6 +1313,8 @@ static int diag_cmd_set_log_mask(unsigned char *src_buf, int src_len, mutex_lock(&mask_info->lock); for (i = 0; i < MAX_EQUIP_ID && !status; i++, mask++) { if (!mask || !mask->ptr) continue; if (mask->equip_id != req->equip_id) continue; mutex_lock(&mask->lock); Loading Loading @@ -1432,10 +1436,12 @@ static int diag_cmd_disable_log_mask(unsigned char *src_buf, int src_len, return -EINVAL; } for (i = 0; i < MAX_EQUIP_ID; i++, mask++) { if (mask && mask->ptr) { mutex_lock(&mask->lock); memset(mask->ptr, 0, mask->range); mutex_unlock(&mask->lock); } } mask_info->status = DIAG_CTRL_MASK_ALL_DISABLED; mutex_unlock(&driver->md_session_lock); if (diag_check_update(APPS_DATA)) Loading
drivers/char/diag/diagfwd_cntl.c +21 −4 Original line number Diff line number Diff line /* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. * * 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 Loading Loading @@ -443,8 +443,8 @@ static void process_last_event_report(uint8_t *buf, uint32_t len, header = (struct diag_ctrl_last_event_report *)ptr; event_size = ((header->event_last_id / 8) + 1); if (event_size >= driver->event_mask_size) { pr_debug("diag: In %s, receiving event mask size more that Apps can handle\n", __func__); DIAG_LOG(DIAG_DEBUG_MASKS, "diag: receiving event mask size more that Apps can handle\n"); temp = krealloc(driver->event_mask->ptr, event_size, GFP_KERNEL); if (!temp) { Loading Loading @@ -558,6 +558,10 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len, mask_ptr = (struct diag_msg_mask_t *)msg_mask.ptr; found = 0; for (j = 0; j < driver->msg_mask_tbl_count; j++, mask_ptr++) { if (!mask_ptr || !ssid_range) { found = 1; break; } if (mask_ptr->ssid_first != ssid_range->ssid_first) continue; mutex_lock(&mask_ptr->lock); Loading @@ -576,6 +580,8 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len, new_size = (driver->msg_mask_tbl_count + 1) * sizeof(struct diag_msg_mask_t); DIAG_LOG(DIAG_DEBUG_MASKS, "diag: receiving msg mask size more that Apps can handle\n"); temp = krealloc(msg_mask.ptr, new_size, GFP_KERNEL); if (!temp) { pr_err("diag: In %s, Unable to add new ssid table to msg mask, ssid first: %d, last: %d\n", Loading @@ -584,6 +590,7 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len, continue; } msg_mask.ptr = temp; mask_ptr = (struct diag_msg_mask_t *)msg_mask.ptr; err = diag_create_msg_mask_table_entry(mask_ptr, ssid_range); if (err) { pr_err("diag: In %s, Unable to create a new msg mask table entry, first: %d last: %d err: %d\n", Loading Loading @@ -623,6 +630,10 @@ static void diag_build_time_mask_update(uint8_t *buf, num_items = range->ssid_last - range->ssid_first + 1; for (i = 0; i < driver->bt_msg_mask_tbl_count; i++, build_mask++) { if (!build_mask) { found = 1; break; } if (build_mask->ssid_first != range->ssid_first) continue; found = 1; Loading @@ -633,7 +644,8 @@ static void diag_build_time_mask_update(uint8_t *buf, __func__); } dest_ptr = build_mask->ptr; for (j = 0; j < build_mask->range; j++, mask_ptr++, dest_ptr++) for (j = 0; (j < build_mask->range) && mask_ptr && dest_ptr; j++, mask_ptr++, dest_ptr++) *(uint32_t *)dest_ptr |= *mask_ptr; mutex_unlock(&build_mask->lock); break; Loading @@ -641,8 +653,12 @@ static void diag_build_time_mask_update(uint8_t *buf, if (found) goto end; new_size = (driver->bt_msg_mask_tbl_count + 1) * sizeof(struct diag_msg_mask_t); DIAG_LOG(DIAG_DEBUG_MASKS, "diag: receiving build time mask size more that Apps can handle\n"); temp = krealloc(driver->build_time_mask->ptr, new_size, GFP_KERNEL); if (!temp) { pr_err("diag: In %s, unable to create a new entry for build time mask\n", Loading @@ -650,6 +666,7 @@ static void diag_build_time_mask_update(uint8_t *buf, goto end; } driver->build_time_mask->ptr = temp; build_mask = (struct diag_msg_mask_t *)driver->build_time_mask->ptr; err = diag_create_msg_mask_table_entry(build_mask, range); if (err) { pr_err("diag: In %s, Unable to create a new msg mask table entry, err: %d\n", Loading
drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_fw_update.c +3 −1 Original line number Diff line number Diff line Loading @@ -681,10 +681,12 @@ static enum flash_area fwu_go_nogo(struct image_header_data *header) goto exit; } while (strptr[index] >= '0' && strptr[index] <= '9') { while ((index < MAX_FIRMWARE_ID_LEN - 1) && strptr[index] >= '0' && strptr[index] <= '9') { firmware_id[index] = strptr[index]; index++; } firmware_id[index] = '\0'; retval = sstrtoul(firmware_id, 10, &image_fw_id); kfree(firmware_id); Loading
drivers/misc/qseecom.c +5 −6 Original line number Diff line number Diff line /*Qualcomm Secure Execution Environment Communicator (QSEECOM) driver * * 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 * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -8783,6 +8783,7 @@ exit_unreg_chrdev_region: static int qseecom_remove(struct platform_device *pdev) { struct qseecom_registered_kclient_list *kclient = NULL; struct qseecom_registered_kclient_list *kclient_tmp = NULL; unsigned long flags = 0; int ret = 0; int i; Loading @@ -8792,10 +8793,8 @@ static int qseecom_remove(struct platform_device *pdev) atomic_set(&qseecom.qseecom_state, QSEECOM_STATE_NOT_READY); spin_lock_irqsave(&qseecom.registered_kclient_list_lock, flags); list_for_each_entry(kclient, &qseecom.registered_kclient_list_head, list) { if (!kclient) goto exit_irqrestore; list_for_each_entry_safe(kclient, kclient_tmp, &qseecom.registered_kclient_list_head, list) { /* Break the loop if client handle is NULL */ if (!kclient->handle) Loading @@ -8819,7 +8818,7 @@ exit_free_kc_handle: kzfree(kclient->handle); exit_free_kclient: kzfree(kclient); exit_irqrestore: spin_unlock_irqrestore(&qseecom.registered_kclient_list_lock, flags); if (qseecom.qseos_version > QSEEE_VERSION_00) Loading
drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c +2 −0 Original line number Diff line number Diff line Loading @@ -1432,6 +1432,8 @@ static int ipa_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /* Extended IOCTLs */ case RMNET_IOCTL_EXTENDED: if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) return -EPERM; IPAWANDBG("get ioctl: RMNET_IOCTL_EXTENDED\n"); if (copy_from_user(&extend_ioctl_data, (u8 *)ifr->ifr_ifru.ifru_data, Loading