dect
/
linux-2.6
Archived
13
0
Fork 0

drm: dereference of tmp in drm_proc_create_files()

tmp allocation may fail, prevent a dereference.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Roel Kluin 2009-08-29 22:20:34 +02:00 committed by Dave Airlie
parent ff846ab7f7
commit 1ae70072f0
1 changed files with 4 additions and 0 deletions

View File

@ -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",