Bug 16375 - missing blit_vb check in r600_prepare_blit_copy
Summary: missing blit_vb check in r600_prepare_blit_copy
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - non Intel) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_video-dri
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 20:56 UTC by Alexander Y. Fomichev
Modified: 2012-08-09 14:24 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.35-rc4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Alexander Y. Fomichev 2010-07-12 20:56:43 UTC
r600_prepare_blit_copy issing check of dev_priv->blit_vb to be filled by r600_nomm_get_vb. r600_nomm_get_vb can fail and return EAGAIN and we'll see a NULL pointer dereference.
fix:
--- git/linux-2.6/drivers/gpu/drm/radeon/r600_blit.c    2010-03-09 23:26:42.601820012 +0300
+++ linux-2.6.35-rc4/drivers/gpu/drm/radeon/r600_blit.c 2010-07-12 23:55:43.246560111 +0400
@@ -541,6 +541,8 @@ r600_prepare_blit_copy(struct drm_device
        DRM_DEBUG("\n");

        r600_nomm_get_vb(dev);
+       if (!dev_priv->blit_vb)
+               return;

        dev_priv->blit_vb->file_priv = file_priv;
Comment 1 Andrew Morton 2010-07-15 18:41:49 UTC
Please don't send patches via bugzilla - it causes lots of problems with
our usual patch management and review processes.

Please send this patch via email as per Documentation/SubmittingPatches. 
Suitable recipients may be found via scripts/get_maintainer.pl.  Please
also cc myself on the email.

Thanks.
Comment 2 Alexander Y. Fomichev 2010-07-20 09:41:15 UTC
tnx for reply, i've sent patch with cc to you.

Note You need to log in before you can comment on or make changes to this bug.