diff options
| author | Manoj Prabhu B <bmanoj@codeaurora.org> | 2017-01-17 10:15:53 +0530 |
|---|---|---|
| committer | Manoj Prabhu B <bmanoj@codeaurora.org> | 2017-01-17 10:18:43 +0530 |
| commit | c015bcde8f2c90ca6e8daad5c11adb60d3911957 (patch) | |
| tree | 0811cff66232b58ce9f8586c6f219d321275b694 | |
| parent | 55e8426a192811d7567f19d7e781727f46b0406d (diff) | |
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: Manoj Prabhu B <bmanoj@codeaurora.org>
| -rw-r--r-- | drivers/char/diag/diagchar_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/diag/diagchar_core.c b/drivers/char/diag/diagchar_core.c index 76559633f387..29272b96e5a9 100644 --- a/drivers/char/diag/diagchar_core.c +++ b/drivers/char/diag/diagchar_core.c @@ -1,4 +1,4 @@ -/* 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; |
