diff options
| author | Satyajit Desai <sadesai@codeaurora.org> | 2017-01-26 14:22:16 -0800 |
|---|---|---|
| committer | Satyajit Desai <sadesai@codeaurora.org> | 2017-01-30 11:10:32 -0800 |
| commit | e35d312a77fbaeab9e87f2005499450320c9d010 (patch) | |
| tree | 958f59a7523c64ac97f0337d82a5e973f2b6babf | |
| parent | 24377df2b44eb5d8b11571be6fb18fbc9c24b600 (diff) | |
coresight: Add NULL pointer check for build paths
Fail the path building if we end up without a valid device
in our build path either due to incorrect device tree or
an incorrect defconfig.
Change-Id: I89b6b8544234251e10ebd4e1338b639685a9ff93
Signed-off-by: Satyajit Desai <sadesai@codeaurora.org>
| -rw-r--r-- | drivers/hwtracing/coresight/coresight.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index c34599c0594d..9b0cc7baca73 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2016 The Linux Foundation. All rights reserved. +/* Copyright (c) 2012, 2016-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 @@ -309,6 +309,9 @@ static int coresight_build_paths(struct coresight_device *csdev, int i, ret = -EINVAL; struct coresight_connection *conn; + if (!csdev) + return ret; + list_add(&csdev->path_link, path); if ((csdev->type == CORESIGHT_DEV_TYPE_SINK || |
