aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDarren Jenkins <darrenrjenkins@gmail.com>2009-12-29 20:18:30 -0500
committerDave Airlie <airlied@redhat.com>2010-01-06 22:56:06 -0500
commit875c186620e017e62b773c93e46af21bb704fe6b (patch)
tree56c7a77d40b9c5f780f636f5e4aa425b31897fd7 /drivers
parent3655d54af8dd85788c3e5088387469703a0f8f12 (diff)
drm/radeon/radeon_device.c: move a dereference below a NULL test
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13335 Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
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 7c6848096bcd..0c51f8e46613 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -733,16 +733,18 @@ void radeon_device_fini(struct radeon_device *rdev)
733 */ 733 */
734int radeon_suspend_kms(struct drm_device *dev, pm_message_t state) 734int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
735{ 735{
736 struct radeon_device *rdev = dev->dev_private; 736 struct radeon_device *rdev;
737 struct drm_crtc *crtc; 737 struct drm_crtc *crtc;
738 int r; 738 int r;
739 739
740 if (dev == NULL || rdev == NULL) { 740 if (dev == NULL || dev->dev_private == NULL) {
741 return -ENODEV; 741 return -ENODEV;
742 } 742 }
743 if (state.event == PM_EVENT_PRETHAW) { 743 if (state.event == PM_EVENT_PRETHAW) {
744 return 0; 744 return 0;
745 } 745 }
746 rdev = dev->dev_private;
747
746 /* unpin the front buffers */ 748 /* unpin the front buffers */
747 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 749 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
748 struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->fb); 750 struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->fb);