* [PATCH] drm/radeon/radeon_device.c: move a dereference below a
@ 2009-12-30 1:18 Darren Jenkins
0 siblings, 0 replies; only message in thread
From: Darren Jenkins @ 2009-12-30 1:18 UTC (permalink / raw)
To: David Airlie, dri-devel mailing list, Kernel Janitors
Cc: Linux Kernel Mailing List
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>
diff --git drivers/gpu/drm/radeon/radeon_device.c drivers/gpu/drm/radeon/radeon_device.c
index 7c68480..0c51f8e 100644
--- drivers/gpu/drm/radeon/radeon_device.c
+++ drivers/gpu/drm/radeon/radeon_device.c
@@ -733,16 +733,18 @@ void radeon_device_fini(struct radeon_device *rdev)
*/
int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
{
- struct radeon_device *rdev = dev->dev_private;
+ struct radeon_device *rdev;
struct drm_crtc *crtc;
int r;
- if (dev = NULL || rdev = NULL) {
+ if (dev = NULL || dev->dev_private = NULL) {
return -ENODEV;
}
if (state.event = PM_EVENT_PRETHAW) {
return 0;
}
+ rdev = dev->dev_private;
+
/* unpin the front buffers */
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->fb);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-12-30 1:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30 1:18 [PATCH] drm/radeon/radeon_device.c: move a dereference below a Darren Jenkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox