Thanks for finding that. You can apply the patch.

Although the cleanup_dma function isn't used at all in the gamma
driver yet (it should be - I know), but the AGP code hasn't been
tested a whole lot either.

Alan.

On Sun, Apr 14, 2002 at 11:00:02 +0100, Jos Fonseca wrote:
> When I found what I believe to be a bug in gamma DRM which could lead to a 
> kernel oops on PCI cards.
> 
> The line is gamma_dma.c:669:
> 
>               DRM_IOREMAPFREE( dev_priv->buffers );
> 
> but dev_priv->buffers has a non-NULL value only if it's not a PCI card, as 
> seen in gamma_dma.c:625:
> 
>         if (init->pcimode) {
> 
>                 ...
> 
>         } else {
>                 DRM_FIND_MAP( dev_priv->buffers, init->buffers_offset );
> 
>                 DRM_IOREMAP( dev_priv->buffers );
> 
>               ...
> 
> (remember that the dev_priv structure is set to 0 in the beginning)
> 
> and the definition of DRM_IOREMAPFREE is
> 
> #define DRM_IOREMAPFREE(map)                                            \
>         do {                                                            \
>                 if ( (map)->handle && (map)->size )                     \
>                         DRM(ioremapfree)( (map)->handle, (map)->size ); \
>         } while (0)
> 
> 
> so it will attempt to reference a NULL pointer (as it did on my system 
> with the mach64).
> 
> The code at gamma_dma.c:669 should be instead
> 
>               if( dev_priv->buffers ) {
>                       DRM_IOREMAPFREE( dev_priv->buffers );
>               }
> 
> Jos Fonseca
> 
> _______________________________________________
> Dri-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dri-devel

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to