Commit 1c23a046 authored by Tony Luck's avatar Tony Luck

Merge agluck-lia64.sc.intel.com:/data/home/aegl/BK/work/stephane

into agluck-lia64.sc.intel.com:/data/home/aegl/BK/linux-ia64-release-2.6.9
parents c8e07952 295d4eb5
......@@ -2227,6 +2227,15 @@ pfm_alloc_fd(struct file **cfile)
static void
pfm_free_fd(int fd, struct file *file)
{
struct files_struct *files = current->files;
/*
* there ie no fd_uninstall(), so we do it here
*/
spin_lock(&files->file_lock);
files->fd[fd] = NULL;
spin_unlock(&files->file_lock);
if (file) put_filp(file);
put_unused_fd(fd);
}
......@@ -2659,8 +2668,10 @@ pfm_context_create(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg
ctx = pfm_context_alloc();
if (!ctx) goto error;
req->ctx_fd = ctx->ctx_fd = pfm_alloc_fd(&filp);
if (req->ctx_fd < 0) goto error_file;
ret = pfm_alloc_fd(&filp);
if (ret < 0) goto error_file;
req->ctx_fd = ctx->ctx_fd = ret;
/*
* attach context to file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment