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

Commit c015bcde authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: Prevent possible NULL pointer dereferencing



This patch removes the NULL check for item after
it is being accessed.

CRs-Fixed: 1108407
Change-Id: Ie57e4e2f0d626f8780c7424d295fa05bf4147ece
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 55e8426a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2017, 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
@@ -704,7 +704,7 @@ struct diag_cmd_reg_entry_t *diag_cmd_search(

	list_for_each_safe(start, temp, &driver->cmd_reg_list) {
		item = list_entry(start, struct diag_cmd_reg_t, link);
		if (item == NULL || &item->entry == NULL) {
		if (&item->entry == NULL) {
			pr_err("diag: In %s, unable to search command\n",
			       __func__);
			return NULL;