gpu: ion: Check for null name argument

Add check for null argument to avoid dereferencing
a null-pointer.

Change-Id: Icb452d0764e375bf2684e013c51d260de98e8583
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
This commit is contained in:
Olav Haugan 2012-05-16 13:11:41 -07:00 committed by Stephen Boyd
parent 8876e13360
commit 87d9a20aa2

View file

@ -931,7 +931,13 @@ struct ion_client *ion_client_create(struct ion_device *dev,
struct rb_node *parent = NULL;
struct ion_client *entry;
pid_t pid;
unsigned int name_len = strnlen(name, 64);
unsigned int name_len;
if (!name) {
pr_err("%s: Name cannot be null\n", __func__);
return ERR_PTR(-EINVAL);
}
name_len = strnlen(name, 64);
get_task_struct(current->group_leader);
task_lock(current->group_leader);