drm/vc4: simplify exit path of a failed allocation of dsi_connector
authorColin Ian King <colin.king@canonical.com>
Fri, 3 Feb 2017 19:56:24 +0000 (19:56 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:57:31 +0000 (15:57 +0100)
commit29cfe97c69d02eedebf3c5a9f51a5cf9a5980c8d
tree09ce6bd1aab378b5c7c41dcf5f46219b5f45985b
parent8402b7ba390387b322759fe29f7b81b965776061
drm/vc4: simplify exit path of a failed allocation of dsi_connector

If dsi_connector fails to allocate, the exit path via label 'fail'
checks if connector is null, which it always is, so the cleanup
that destroys connector is never going to be called.  Hence the
failure path can be more optimally performed by removing this
and just returning ERR_PTR(-ENOMEM).  This also removes the need
to initialize connector to NULL, and we can also remove ret too.

Detected by CoverityScan, CID#1399504 ("Logicall Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170203195624.7189-1-colin.king@canonical.com
(cherry picked from commit fce6a7bc22114c69b071bcf6fbfea2d07de6273c)
drivers/gpu/drm/vc4/vc4_dsi.c