#ifdef __alpha__
map->offset += dev->hose->mem_space->start;
#endif
- map->offset = map->offset + dev->agp->base;
+ map->offset += dev->agp->base;
map->mtrr = dev->agp->agp_mtrr; /* for getmap */
break;
#endif
DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);
return -EINVAL;
}
- map->offset = map->offset + dev->sg->handle;
+ map->offset += dev->sg->handle;
break;
default:
/* No allocations failed, so now we can replace the orginal pagelist
* with the new one.
*/
- DRM(free)(dma->pagelist,
- dma->page_count * sizeof(*dma->pagelist),
- DRM_MEM_PAGES);
+ if (dma->page_count) {
+ DRM(free)(dma->pagelist,
+ dma->page_count * sizeof(*dma->pagelist),
+ DRM_MEM_PAGES);
+ }
dma->pagelist = temp_pagelist;
dma->buf_count += entry->buf_count;
#ifdef __alpha__
map->offset += dev->hose->mem_space->start;
#endif
- map->offset = map->offset + dev->agp->base;
+ map->offset += dev->agp->base;
map->mtrr = dev->agp->agp_mtrr; /* for getmap */
break;
#endif
DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);
return -EINVAL;
}
- map->offset = map->offset + dev->sg->handle;
+ map->offset += dev->sg->handle;
break;
default:
/* No allocations failed, so now we can replace the orginal pagelist
* with the new one.
*/
- DRM(free)(dma->pagelist,
- dma->page_count * sizeof(*dma->pagelist),
- DRM_MEM_PAGES);
+ if (dma->page_count) {
+ DRM(free)(dma->pagelist,
+ dma->page_count * sizeof(*dma->pagelist),
+ DRM_MEM_PAGES);
+ }
dma->pagelist = temp_pagelist;
dma->buf_count += entry->buf_count;