Bug 16375

Summary: missing blit_vb check in r600_prepare_blit_copy
Product: Drivers Reporter: Alexander Y. Fomichev (git.user)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: RESOLVED CODE_FIX    
Severity: normal CC: akpm, alan, alexdeucher
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.35-rc4 Subsystem:
Regression: No Bisected commit-id:

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.