Commit 1ae70072 authored by Roel Kluin's avatar Roel Kluin Committed by Dave Airlie

drm: dereference of tmp in drm_proc_create_files()

tmp allocation may fail, prevent a dereference.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ff846ab7
......@@ -106,6 +106,10 @@ int drm_proc_create_files(struct drm_info_list *files, int count,
continue;
tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
if (tmp == NULL) {
ret = -1;
goto fail;
}
ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root);
if (!ent) {
DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment