aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2009-12-09 11:39:16 -0500
committerDave Airlie <airlied@redhat.com>2009-12-10 00:09:06 -0500
commit4a04a844ba0c09b5641bf2ebd9f9517aa76e52fb (patch)
treeb859af52ab72db2632e0d7da7cc0cf6552f3d136 /drivers
parentb27b63750d912e80d61d2120c4a1664062d0f808 (diff)
drm/radeon/kms: Fix NULL ptr dereference
radeon_atombios_fini might be call while there is not valid atombios structure allocated, thus test for a not null ptr before trying to access this structure. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 7e55647f118e..410859ee112f 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -487,8 +487,10 @@ int radeon_atombios_init(struct radeon_device *rdev)
487 487
488void radeon_atombios_fini(struct radeon_device *rdev) 488void radeon_atombios_fini(struct radeon_device *rdev)
489{ 489{
490 kfree(rdev->mode_info.atom_context->scratch); 490 if (rdev->mode_info.atom_context) {
491 kfree(rdev->mode_info.atom_context); 491 kfree(rdev->mode_info.atom_context->scratch);
492 kfree(rdev->mode_info.atom_context);
493 }
492 kfree(rdev->mode_info.atom_card_info); 494 kfree(rdev->mode_info.atom_card_info);
493} 495}
494 496