drm/client: Fix double free in error path
authorNoralf Trønnes <noralf@tronnes.org>
Thu, 12 Jul 2018 15:04:14 +0000 (17:04 +0200)
committerNoralf Trønnes <noralf@tronnes.org>
Fri, 13 Jul 2018 10:07:46 +0000 (12:07 +0200)
commitcf19fa2cfa4e9b5458b6f3503c5317dd1a2bfbae
tree79b059e80c213063478e971a17ddf622009e1dd3
parenta08eac479b4e6de3700d8d1c7c664d4ffc0535c7
drm/client: Fix double free in error path

This fixes a static checker warning:

drivers/gpu/drm/drm_client.c:289 drm_client_buffer_create()
error: double free of 'buffer'

Extend drm_client_buffer_delete() to handle the case when there's no
dumb buffer attached and drop the extra kfree.

Fixes: c76f0f7cb546 ("drm: Begin an API for in-kernel clients")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180712150414.46908-1-noralf@tronnes.org
drivers/gpu/drm/drm_client.c