Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a10f5f63 authored by Mohit Aggarwal's avatar Mohit Aggarwal Committed by Matt Wagantall
Browse files

diag: dci: Clean up dci registrations properly



Currently, in case of ungraceful exit, DCI client
registration is not cleaned up properly. This patch
fixes this issue.

Change-Id: I8a1a2af33986e5f52cb554bc21dafcb827585006
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent 6ed4bd3a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2081,13 +2081,13 @@ struct diag_dci_client_tbl *diag_dci_get_client_entry(int client_id)
	return NULL;
}

struct diag_dci_client_tbl *dci_lookup_client_entry_pid(int pid)
struct diag_dci_client_tbl *dci_lookup_client_entry_pid(int tgid)
{
	struct list_head *start, *temp;
	struct diag_dci_client_tbl *entry = NULL;
	list_for_each_safe(start, temp, &driver->dci_client_list) {
		entry = list_entry(start, struct diag_dci_client_tbl, track);
		if (entry->client->tgid == pid)
		if (entry->client->tgid == tgid)
			return entry;
	}
	return NULL;
+1 −1
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ void extract_dci_pkt_rsp(unsigned char *buf, int len, int data_source,
			 int token);
void extract_dci_ctrl_pkt(unsigned char *buf, int len, int token);
struct diag_dci_client_tbl *diag_dci_get_client_entry(int client_id);
struct diag_dci_client_tbl *dci_lookup_client_entry_pid(int pid);
struct diag_dci_client_tbl *dci_lookup_client_entry_pid(int tgid);
int diag_process_remote_dci_read_data(int index, void *buf, int recd_bytes);
int diag_dci_get_support_list(struct diag_dci_peripherals_t *support_list);
/* DCI Log streaming functions */
+1 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ static int diagchar_close(struct inode *inode, struct file *file)
	* This will specially help in case of ungraceful exit of any DCI client
	* This call will remove any pending registrations of such client
	*/
	dci_entry = dci_lookup_client_entry_pid(current->pid);
	dci_entry = dci_lookup_client_entry_pid(current->tgid);
	if (dci_entry)
		diag_dci_deinit_client(dci_entry);