diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-29 16:20:34 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-08-30 19:09:29 -0400 |
commit | 1ae70072f0699916c1a77a9bacad958ee46f7395 (patch) | |
tree | e6a0c1b23fa9d17b960b556e71524c3c198cfe07 /drivers/gpu/drm | |
parent | ff846ab7f76ffecba4f0bef026163d2a2364d7d0 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_proc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c index bbd4b3d1074a..dc967af7a33c 100644 --- a/drivers/gpu/drm/drm_proc.c +++ b/drivers/gpu/drm/drm_proc.c | |||
@@ -106,6 +106,10 @@ int drm_proc_create_files(struct drm_info_list *files, int count, | |||
106 | continue; | 106 | continue; |
107 | 107 | ||
108 | tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL); | 108 | tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL); |
109 | if (tmp == NULL) { | ||
110 | ret = -1; | ||
111 | goto fail; | ||
112 | } | ||
109 | ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root); | 113 | ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root); |
110 | if (!ent) { | 114 | if (!ent) { |
111 | DRM_ERROR("Cannot create /proc/dri/%s/%s\n", | 115 | DRM_ERROR("Cannot create /proc/dri/%s/%s\n", |