summaryrefslogtreecommitdiffstats
path: root/drivers/staging/android/ion
diff options
context:
space:
mode:
authorYisheng Xie2018-02-12 11:43:09 +0100
committerGreg Kroah-Hartman2018-02-16 17:29:07 +0100
commitfa976e5e9e5dcd9051345d9625044e755e991569 (patch)
treeb86034432abea8c7594bc6695895b9a336cf5c9c /drivers/staging/android/ion
parentstaging: android: ion: Nuke ion_page_pool_init (diff)
downloadkernel-qcow2-linux-fa976e5e9e5dcd9051345d9625044e755e991569.tar.gz
kernel-qcow2-linux-fa976e5e9e5dcd9051345d9625044e755e991569.tar.xz
kernel-qcow2-linux-fa976e5e9e5dcd9051345d9625044e755e991569.zip
staging: android: ion: Avoid NULL point in error path
If we failed to create debugfs for ion at ion_device_create, the debug_root of ion_device will be NULL, and then when try to create debug file for shrinker of heap it will be create on the top of debugfs. If we also failed to create this the debug file, it call dentry_path to found the path of debug_root, then a NULL point will occur. Fix this by avoiding call dentry_path, but show the debug name only when failed to create debug file for shrinker. Acked-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion')
-rw-r--r--drivers/staging/android/ion/ion.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 57e0d8035b2e..4b6937237895 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -564,13 +564,9 @@ void ion_device_add_heap(struct ion_heap *heap)
debug_file = debugfs_create_file(debug_name,
0644, dev->debug_root, heap,
&debug_shrink_fops);
- if (!debug_file) {
- char buf[256], *path;
-
- path = dentry_path(dev->debug_root, buf, 256);
- pr_err("Failed to create heap shrinker debugfs at %s/%s\n",
- path, debug_name);
- }
+ if (!debug_file)
+ pr_err("Failed to create ion heap shrinker debugfs at %s\n",
+ debug_name);
}
dev->heap_cnt++;