Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228353
b: refs/heads/master
c: 843f65c
h: refs/heads/master
i:
  228351: 89afbff
v: v3
  • Loading branch information
Mark Allyn authored and Greg Kroah-Hartman committed Dec 10, 2010
1 parent 020df91 commit ccc2b95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 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: b0daf59c5fc9ac6c65645ffb40156f5d5a0052a4
refs/heads/master: 843f65c669c1164897dc5ef79c0df00cb66490bf
23 changes: 15 additions & 8 deletions trunk/drivers/staging/sep/sep_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3437,7 +3437,8 @@ static int __devinit sep_probe(struct pci_dev *pdev,
if (sep_dev == NULL) {
dev_warn(&pdev->dev,
"can't kmalloc the sep_device structure\n");
return -ENOMEM;
error = -ENOMEM;
goto end_function_disable_device;
}

/*
Expand All @@ -3448,7 +3449,7 @@ static int __devinit sep_probe(struct pci_dev *pdev,
*/
sep = sep_dev;

sep->pdev = pdev;
sep->pdev = pci_dev_get(pdev);

init_waitqueue_head(&sep->event);
init_waitqueue_head(&sep->event_request_daemon);
Expand All @@ -3466,23 +3467,23 @@ static int __devinit sep_probe(struct pci_dev *pdev,
sep->reg_physical_addr = pci_resource_start(sep->pdev, 0);
if (!sep->reg_physical_addr) {
dev_warn(&sep->pdev->dev, "Error getting register start\n");
pci_dev_put(sep->pdev);
return -ENODEV;
error = -ENODEV;
goto end_function_free_sep_dev;
}

sep->reg_physical_end = pci_resource_end(sep->pdev, 0);
if (!sep->reg_physical_end) {
dev_warn(&sep->pdev->dev, "Error getting register end\n");
pci_dev_put(sep->pdev);
return -ENODEV;
error = -ENODEV;
goto end_function_free_sep_dev;
}

sep->reg_addr = ioremap_nocache(sep->reg_physical_addr,
(size_t)(sep->reg_physical_end - sep->reg_physical_addr + 1));
if (!sep->reg_addr) {
dev_warn(&sep->pdev->dev, "Error getting register virtual\n");
pci_dev_put(sep->pdev);
return -ENODEV;
error = -ENODEV;
goto end_function_free_sep_dev;
}

dev_dbg(&sep->pdev->dev,
Expand Down Expand Up @@ -3573,9 +3574,15 @@ static int __devinit sep_probe(struct pci_dev *pdev,

end_function_error:
iounmap(sep->reg_addr);

end_function_free_sep_dev:
pci_dev_put(sep_dev->pdev);
kfree(sep_dev);
sep_dev = NULL;

end_function_disable_device:
pci_disable_device(pdev);

end_function:
return error;
}
Expand Down

0 comments on commit ccc2b95

Please sign in to comment.