summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-12-17 08:00:38 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2018-12-17 10:47:17 +0100
commit705c8160ce88825d2491aa55fa9da4fa79204c10 (patch)
tree3fa03f7a8f04e2ecf00986c142bfc3f421d595cc /drivers
parentdrm/dp_mst: Refactor drm_dp_update_payload_part1() (diff)
downloadlinux-705c8160ce88825d2491aa55fa9da4fa79204c10.tar.xz
linux-705c8160ce88825d2491aa55fa9da4fa79204c10.zip
drm: Fix an error pointer dereference()
The drm_mode_create_tile_group() is only called from drm_parse_tiled_block() and the caller expects it to return a NULL on error. In other words, this function should match drm_mode_get_tile_group(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20181217065733.GA12159@kadam
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_connector.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index fa9baacc863b..f0dd3315b1b8 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1960,7 +1960,7 @@ EXPORT_SYMBOL(drm_mode_get_tile_group);
* identifier for the tile group.
*
* RETURNS:
- * new tile group or error.
+ * new tile group or NULL.
*/
struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
char topology[8])
@@ -1970,7 +1970,7 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
tg = kzalloc(sizeof(*tg), GFP_KERNEL);
if (!tg)
- return ERR_PTR(-ENOMEM);
+ return NULL;
kref_init(&tg->refcount);
memcpy(tg->group_data, topology, 8);
@@ -1982,7 +1982,7 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
tg->id = ret;
} else {
kfree(tg);
- tg = ERR_PTR(ret);
+ tg = NULL;
}
mutex_unlock(&dev->mode_config.idr_mutex);