summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_abi16.c
diff options
context:
space:
mode:
authorBen Skeggs2014-08-09 20:10:24 +0200
committerBen Skeggs2014-08-09 21:13:21 +0200
commit586491e6fc27f1783081955fd26d70789ddb3a07 (patch)
tree6a17f58b88e0c4e723f94f38225bf8b9252c38ba /drivers/gpu/drm/nouveau/nouveau_abi16.c
parentdrm/nouveau: use ioctl interface for abi16 gpuobj free (diff)
downloadkernel-qcow2-linux-586491e6fc27f1783081955fd26d70789ddb3a07.tar.gz
kernel-qcow2-linux-586491e6fc27f1783081955fd26d70789ddb3a07.tar.xz
kernel-qcow2-linux-586491e6fc27f1783081955fd26d70789ddb3a07.zip
drm/nouveau/device: audit and version NV_DEVICE class
The full object interfaces are about to be exposed to userspace, so we need to check for any security-related issues and version the structs to make it easier to handle any changes we may need in the future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_abi16.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_abi16.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index 3192bbaf3df5..1e312feb12e4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -41,6 +41,10 @@ nouveau_abi16_get(struct drm_file *file_priv, struct drm_device *dev)
struct nouveau_abi16 *abi16;
cli->abi16 = abi16 = kzalloc(sizeof(*abi16), GFP_KERNEL);
if (cli->abi16) {
+ struct nv_device_v0 args = {
+ .device = ~0ULL,
+ };
+
INIT_LIST_HEAD(&abi16->channels);
/* allocate device object targeting client's default
@@ -49,9 +53,7 @@ nouveau_abi16_get(struct drm_file *file_priv, struct drm_device *dev)
*/
if (nvif_device_init(&cli->base.base, NULL,
NOUVEAU_ABI16_DEVICE, NV_DEVICE,
- &(struct nv_device_class) {
- .device = ~0ULL,
- }, sizeof(struct nv_device_class),
+ &args, sizeof(args),
&abi16->device) == 0)
return cli->abi16;