Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207973
b: refs/heads/master
c: 00b81fb
h: refs/heads/master
i:
  207971: 0e68d61
v: v3
  • Loading branch information
Andi Kleen authored and Greg Kroah-Hartman committed Aug 10, 2010
1 parent ca21411 commit c85f4a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 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: 0daeed381c6a33fdbdc3b0e9f09d96f0a2a8a195
refs/heads/master: 00b81fb23a4937a24cb010f41ac173a786eb4c55
20 changes: 7 additions & 13 deletions trunk/drivers/usb/host/uhci-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,18 +495,16 @@ static int uhci_debug_open(struct inode *inode, struct file *file)
{
struct uhci_hcd *uhci = inode->i_private;
struct uhci_debug *up;
int ret = -ENOMEM;
unsigned long flags;

lock_kernel();
up = kmalloc(sizeof(*up), GFP_KERNEL);
if (!up)
goto out;
return -ENOMEM;

up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL);
if (!up->data) {
kfree(up);
goto out;
return -ENOMEM;
}

up->size = 0;
Expand All @@ -517,20 +515,17 @@ static int uhci_debug_open(struct inode *inode, struct file *file)

file->private_data = up;

ret = 0;
out:
unlock_kernel();
return ret;
return 0;
}

static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence)
{
struct uhci_debug *up;
loff_t new = -1;

lock_kernel();
up = file->private_data;

/* XXX: atomic 64bit seek access, but that needs to be fixed in the VFS */
switch (whence) {
case 0:
new = off;
Expand All @@ -539,11 +534,10 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence)
new = file->f_pos + off;
break;
}
if (new < 0 || new > up->size) {
unlock_kernel();

if (new < 0 || new > up->size)
return -EINVAL;
}
unlock_kernel();

return (file->f_pos = new);
}

Expand Down

0 comments on commit c85f4a6

Please sign in to comment.