projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f566911
)
drm: Distinguish no name from ENOMEM in set_unique()
author
Tom Gundersen
<teg@jklm.no>
Wed, 21 Sep 2016 14:59:18 +0000
(16:59 +0200)
committer
Sean Paul
<seanpaul@chromium.org>
Thu, 22 Sep 2016 11:03:42 +0000
(
04:03
-0700)
If passing name == NULL to drm_drv_set_unique() we now get -ENOMEM
as kstrdup() returns NULL. Instead check for this explicitly and
return -EINVAL if no name is provided.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link:
http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-1-teg@jklm.no
drivers/gpu/drm/drm_drv.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/gpu/drm/drm_drv.c
b/drivers/gpu/drm/drm_drv.c
index f2f6429ab04f6a83ecdf73aecb6f2f7c165bdc62..99e67517b5c530eac504a5f319a351bb1f07fb11 100644
(file)
--- a/
drivers/gpu/drm/drm_drv.c
+++ b/
drivers/gpu/drm/drm_drv.c
@@
-338,6
+338,9
@@
void drm_minor_release(struct drm_minor *minor)
static int drm_dev_set_unique(struct drm_device *dev, const char *name)
{
+ if (!name)
+ return -EINVAL;
+
kfree(dev->unique);
dev->unique = kstrdup(name, GFP_KERNEL);