Module: xenomai-3
Branch: next
Commit: 328b0447cfa282fbe926ebbd9113224e4a1c18b9
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=328b0447cfa282fbe926ebbd9113224e4a1c18b9

Author: Jorge Ramirez-Ortiz <jorge.ramirez-or...@linaro.org>
Date:   Thu Aug 13 10:23:16 2015 -0400

drivers/analogy: release pci region if mapping failed

---

 kernel/drivers/analogy/national_instruments/mite.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/drivers/analogy/national_instruments/mite.c 
b/kernel/drivers/analogy/national_instruments/mite.c
index 84dbdda..be4b268 100644
--- a/kernel/drivers/analogy/national_instruments/mite.c
+++ b/kernel/drivers/analogy/national_instruments/mite.c
@@ -127,7 +127,7 @@ int a4l_mite_setup(struct mite_struct *mite, int 
use_iodwbsr_1)
 
        pci_set_master(mite->pcidev);
 
-       if (pci_request_regions( mite->pcidev, "mite")) {
+       if (pci_request_regions(mite->pcidev, "mite")) {
                __a4l_err("failed to request mite io regions\n");
                return -EIO;
        };
@@ -139,6 +139,7 @@ int a4l_mite_setup(struct mite_struct *mite, int 
use_iodwbsr_1)
        mite->mite_io_addr = ioremap(addr, length);
        if (!mite->mite_io_addr) {
                __a4l_err("failed to remap mite io memory address\n");
+               pci_release_regions(mite->pcidev);
                return -ENOMEM;
        }
 
@@ -154,6 +155,7 @@ int a4l_mite_setup(struct mite_struct *mite, int 
use_iodwbsr_1)
        mite->daq_io_addr = ioremap(mite->daq_phys_addr, length);
        if (!mite->daq_io_addr) {
                __a4l_err("failed to remap daq io memory address\n");
+               pci_release_regions(mite->pcidev);
                return -ENOMEM;
        }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to