mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
coresight: return error if null or error is passed to coresight_register
Fail coresight_register if invalid (error or null) argument is passed to avoid crashes. Change-Id: I6c39ba2b81333f24480fdf5b348934651e095be5 Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
This commit is contained in:
parent
f55d6eee8a
commit
46fe66a7c8
1 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -566,6 +566,9 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
|
||||||
struct coresight_device *csdev;
|
struct coresight_device *csdev;
|
||||||
struct coresight_connection *conns;
|
struct coresight_connection *conns;
|
||||||
|
|
||||||
|
if (IS_ERR_OR_NULL(desc))
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
csdev = kzalloc(sizeof(*csdev), GFP_KERNEL);
|
csdev = kzalloc(sizeof(*csdev), GFP_KERNEL);
|
||||||
if (!csdev) {
|
if (!csdev) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue