Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18254
b: refs/heads/master
c: fe34765
h: refs/heads/master
v: v3
  • Loading branch information
Dave Airlie authored and Dave Airlie committed Jan 2, 2006
1 parent cb7d817 commit e564903
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3a80a223d5f1af1e1713383376e5472cec4e20c
refs/heads/master: fe34765be1ee9465b10406e6e5dddbd43ddc4fbe
15 changes: 10 additions & 5 deletions trunk/drivers/char/drm/drm_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,22 @@ int drm_setunique(struct inode *inode, struct file *filp,

static int drm_set_busid(drm_device_t * dev)
{
int len;

if (dev->unique != NULL)
return EBUSY;

dev->unique_len = 20;
dev->unique_len = 40;
dev->unique = drm_alloc(dev->unique_len + 1, DRM_MEM_DRIVER);
if (dev->unique == NULL)
return ENOMEM;

snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
len = snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func);

if (len > dev->unique_len)
DRM_ERROR("Unique buffer overflowed\n");

dev->devname =
drm_alloc(strlen(dev->driver->pci_driver.name) + dev->unique_len +
2, DRM_MEM_DRIVER);
Expand Down Expand Up @@ -239,7 +244,7 @@ int drm_getclient(struct inode *inode, struct file *filp,
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev;
drm_client_t __user *argp = (void __user *)arg;
drm_client_t __user *argp = (drm_client_t __user *)arg;
drm_client_t client;
drm_file_t *pt;
int idx;
Expand All @@ -262,7 +267,7 @@ int drm_getclient(struct inode *inode, struct file *filp,
client.iocs = pt->ioctl_count;
up(&dev->struct_sem);

if (copy_to_user((drm_client_t __user *) arg, &client, sizeof(client)))
if (copy_to_user(argp, &client, sizeof(client)))
return -EFAULT;
return 0;
}
Expand Down Expand Up @@ -339,7 +344,7 @@ int drm_setversion(DRM_IOCTL_ARGS)
if (sv.drm_di_major != DRM_IF_MAJOR ||
sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR)
return EINVAL;
if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_dd_minor);
if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_di_minor);
dev->if_version = DRM_MAX(if_version, dev->if_version);
if (sv.drm_di_minor >= 1) {
/*
Expand Down

0 comments on commit e564903

Please sign in to comment.