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

Commit 03c2a8cc authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: dci: Prevent task deallocation and possible resource leak



Prevent DCI clients' task structs from being deallocated to provide
diag driver a chance to clean up its dci client list. Also update
dci client list pid reference count properly to prevent any resource
leakage.

Bug: 68726653
Change-Id: I31c61442a48ac263fd9ff341f6c29db8ace90952
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 89082756
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3085,6 +3085,9 @@ int diag_dci_deinit_client(struct diag_dci_client_tbl *entry)
	if (!list_empty(&entry->track))
		list_del(&entry->track);
	driver->num_dci_client--;

	put_task_struct(entry->client);
	entry->client = NULL;
	/*
	 * Clear the client's log and event masks, update the cumulative
	 * masks and send the masks to peripherals
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/sched.h>
#include <linux/ratelimit.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/platform_device.h>
#include <linux/msm_mhi.h>
#ifdef CONFIG_DIAG_OVER_USB