drm/msm: uninitialized variable in msm_gem_import()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Oct 2021 08:13:15 +0000 (11:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:33 +0000 (19:16 +0100)
commitfbc24df3a5f671fe202a3b1a58eb446bc6dd3775
treea3328b9b1cda6740e8117c33aad14ba98b77ab71
parent3464103cf485b8b55446d33ae2a41e56d662bc48
drm/msm: uninitialized variable in msm_gem_import()

[ Upstream commit 2203bd0e5c12ffc53ffdd4fbd7b12d6ba27e0424 ]

The msm_gem_new_impl() function cleans up after itself so there is no
need to call drm_gem_object_put().  Conceptually, it does not make sense
to call a kref_put() function until after the reference counting has
been initialized which happens immediately after this call in the
drm_gem_(private_)object_init() functions.

In the msm_gem_import() function the "obj" pointer is uninitialized, so
it will lead to a crash.

Fixes: 05b849111c07 ("drm/msm: prime support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211013081315.GG6010@kili
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/msm_gem.c