diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-09 03:11:51 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-09 03:11:50 -0800 |
commit | 2d3372a5f8dea7765e04ed7eb4f9c9aa5499f001 (patch) | |
tree | 1866797b43cd5275e00cfe4d2679cd6120acdcfb | |
parent | e5508c550ced1b0c0036c9ec311a6834d22e7961 (diff) | |
parent | 58852d2945d773a5d0f6d20329ed3d4d40f75eb6 (diff) |
Merge "diag: dci: Check for valid dci client entry"
-rw-r--r-- | drivers/char/diag/diag_dci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/diag/diag_dci.c b/drivers/char/diag/diag_dci.c index f47b390375c4..2c7662a24cd1 100644 --- a/drivers/char/diag/diag_dci.c +++ b/drivers/char/diag/diag_dci.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-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 @@ -2203,8 +2203,9 @@ struct diag_dci_client_tbl *dci_lookup_client_entry_pid(int tgid) 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 == tgid) - return entry; + if (entry->client && entry->tgid == entry->client->tgid) + if (entry->client->tgid == tgid) + return entry; } return NULL; } |