drm/omap: fix possible NULL ref issue in tiler_reserve_2d
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 29 Mar 2018 10:40:37 +0000 (13:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:02:55 +0000 (04:02 +0900)
commita490d0570df2d7fe7ffe40e4049c7846677aa078
tree1d253676f15b009179595605ed6c90e7137a5d0a
parent9631f32b61dcdaf4f52976f3706364f470cfcca0
drm/omap: fix possible NULL ref issue in tiler_reserve_2d

[ Upstream commit 6a0f0c55619f0b82a677cab72e77c3444a5eee58 ]

tiler_reserve_2d allocates memory but does not check if it got the
memory. Add the check and return ENOMEM on failure.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180329104038.29154-2-tomi.valkeinen@ti.com
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c