drm/radeon: fix error handling in radeon_driver_open_kms
authorChristian König <christian.koenig@amd.com>
Mon, 17 Jan 2022 09:31:26 +0000 (10:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:19 +0000 (11:05 +0100)
commitf22f67b43775fffb09f371ea861779cdbbb763ec
treedc133780f6326ccc25241667ef284c4b8b98d0e5
parent16c436fa4f748c6d5a65acf749e6054801784a2f
drm/radeon: fix error handling in radeon_driver_open_kms

commit 4722f463896cc0ef1a6f1c3cb2e171e949831249 upstream.

The return value was never initialized so the cleanup code executed when
it isn't even necessary.

Just add proper error handling.

Fixes: ab50cb9df889 ("drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()")
Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_kms.c