diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-07-13 23:20:20 +0200 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-07-15 15:55:37 +1000 |
commit | d25e3a6faa82eeaa6e5487c2d2e27cfd938ed108 (patch) | |
tree | 76daab3e4ac8b34f205429cec03317121fa37299 /drivers/gpu/drm/drm_debugfs.c | |
parent | 069a9dce384e211784ce6fdfaf1f13921327480d (diff) | |
download | linux-d25e3a6faa82eeaa6e5487c2d2e27cfd938ed108.tar.bz2 |
drm: drm_debugfs, check kmalloc retval
Check kmalloc return value in drm_debugfs_create_files and bail out
appropriately if the pointer is NULL.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/drm_debugfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 2960b6d73456..9903f270e440 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -101,6 +101,10 @@ int drm_debugfs_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 = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, root, tmp, &drm_debugfs_fops); if (!ent) { |