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

Commit 622f034e authored by Manoj Prabhu B's avatar Manoj Prabhu B Committed by Gerrit - the friendly Code Review server
Browse files

diag: Prevent resource leakage of task structure



The task structure with reference count incremented while
dci client is registered should be updated with reference count
decremented in failure case of registration.

Change-Id: I093229d83dca2699e0343224756895eff0915e38
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 9d3de467
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, 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
@@ -3136,6 +3136,7 @@ int diag_dci_register_client(struct diag_dci_reg_tbl_t *reg_entry)
		kfree(new_entry);
		new_entry = NULL;
	}
	put_task_struct(current);
	mutex_unlock(&driver->dci_mutex);
	return DIAG_DCI_NO_REG;
}