Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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",