diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-09-08 16:50:38 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-09 13:52:59 +0200 |
commit | 8e67cdbc2f7b57bc1448c505ce5c20e60238728b (patch) | |
tree | df128c8ebe563e049eb5006ca0b50a91f6e8907d /drivers/hwtracing/coresight/coresight.c | |
parent | 3ba1eb17b633b419737b65429fa7124ce87c5efc (diff) |
coresight: perf: deal with error condition properly
Function coresight_build_path() should return -ENOMEM when kzalloc
fails to allocated the requested memory. That way callers can deal
with the error condition in a similar way.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight.c')
-rw-r--r-- | drivers/hwtracing/coresight/coresight.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index fcbedd3905e3..7bf00a0beb6f 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -429,7 +429,7 @@ struct list_head *coresight_build_path(struct coresight_device *csdev) path = kzalloc(sizeof(struct list_head), GFP_KERNEL); if (!path) - return NULL; + return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(path); |