summaryrefslogtreecommitdiff
path: root/bsd-core/drm_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core/drm_auth.c')
-rw-r--r--bsd-core/drm_auth.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c
index f3aafe44..b5fc5587 100644
--- a/bsd-core/drm_auth.c
+++ b/bsd-core/drm_auth.c
@@ -43,7 +43,7 @@ static int drm_hash_magic(drm_magic_t magic)
/**
* Returns the file private associated with the given magic number.
*/
-static drm_file_t *drm_find_file(struct drm_device *dev, drm_magic_t magic)
+static struct drm_file *drm_find_file(struct drm_device *dev, drm_magic_t magic)
{
drm_magic_entry_t *pt;
int hash = drm_hash_magic(magic);
@@ -63,7 +63,7 @@ static drm_file_t *drm_find_file(struct drm_device *dev, drm_magic_t magic)
* Inserts the given magic number into the hash table of used magic number
* lists.
*/
-static int drm_add_magic(struct drm_device *dev, drm_file_t *priv,
+static int drm_add_magic(struct drm_device *dev, struct drm_file *priv,
drm_magic_t magic)
{
int hash;
@@ -75,7 +75,8 @@ static int drm_add_magic(struct drm_device *dev, drm_file_t *priv,
hash = drm_hash_magic(magic);
entry = malloc(sizeof(*entry), M_DRM, M_ZERO | M_NOWAIT);
- if (!entry) return ENOMEM;
+ if (!entry)
+ return ENOMEM;
entry->magic = magic;
entry->priv = priv;
entry->next = NULL;
@@ -117,11 +118,11 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic)
if (prev) {
prev->next = pt->next;
}
+ free(pt, M_DRM);
return 0;
}
}
- free(pt, M_DRM);
return EINVAL;
}
@@ -136,9 +137,9 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic)
int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
static drm_magic_t sequence = 0;
- drm_auth_t *auth = data;
+ struct drm_auth *auth = data;
- /* Find unique magic */
+ /* Find unique magic */
if (file_priv->magic) {
auth->magic = file_priv->magic;
} else {
@@ -167,8 +168,8 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
int drm_authmagic(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- drm_auth_t *auth = data;
- drm_file_t *priv;
+ struct drm_auth *auth = data;
+ struct drm_file *priv;
DRM_DEBUG("%u\n", auth->magic);