Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/drm-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/drm-2.6:
drm: Copy back ioctl data to userspace regardless of return code.
drm: Round size of SHM maps to PAGE_SIZE

+9 -1
+8
drivers/gpu/drm/drm_bufs.c
··· 170 170 } 171 171 DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n", 172 172 (unsigned long long)map->offset, map->size, map->type); 173 + 174 + /* page-align _DRM_SHM maps. They are allocated here so there is no security 175 + * hole created by that and it works around various broken drivers that use 176 + * a non-aligned quantity to map the SAREA. --BenH 177 + */ 178 + if (map->type == _DRM_SHM) 179 + map->size = PAGE_ALIGN(map->size); 180 + 173 181 if ((map->offset & (~(resource_size_t)PAGE_MASK)) || (map->size & (~PAGE_MASK))) { 174 182 drm_free(map, sizeof(*map), DRM_MEM_MAPS); 175 183 return -EINVAL;
+1 -1
drivers/gpu/drm/drm_drv.c
··· 481 481 } 482 482 retcode = func(dev, kdata, file_priv); 483 483 484 - if ((retcode == 0) && (cmd & IOC_OUT)) { 484 + if (cmd & IOC_OUT) { 485 485 if (copy_to_user((void __user *)arg, kdata, 486 486 _IOC_SIZE(cmd)) != 0) 487 487 retcode = -EFAULT;