Skip to content

Commit

Permalink
drm: dereference of tmp in drm_proc_create_files()
Browse files Browse the repository at this point in the history
tmp allocation may fail, prevent a dereference.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Roel Kluin authored and Dave Airlie committed Aug 30, 2009
1 parent ff846ab commit 1ae7007
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/drm_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1ae7007

Please sign in to comment.