306-rt2x00-Fix-module-loading-in-case-of-error-rt2800p.patch 887 B

1234567891011121314151617181920212223242526272829303132
  1. From 14f870b27b836acee5f04809287175016ca16b05 Mon Sep 17 00:00:00 2001
  2. From: Ivo van Doorn <[email protected]>
  3. Date: Sun, 15 Mar 2009 15:13:58 +0100
  4. Subject: [PATCH] rt2x00: Fix module loading in case of error (rt2800pci)
  5. Signed-off-by: Ivo van Doorn <[email protected]>
  6. ---
  7. drivers/net/wireless/rt2x00/rt2800pci.c | 9 +++++++++
  8. 1 files changed, 9 insertions(+), 0 deletions(-)
  9. --- a/drivers/net/wireless/rt2x00/rt2800pci.c
  10. +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  11. @@ -3014,10 +3014,19 @@ static int __init rt2800pci_init(void)
  12. #ifdef CONFIG_RT2800PCI_WISOC
  13. ret = platform_driver_register(&rt2800soc_driver);
  14. + if (ret)
  15. + return ret;
  16. #endif
  17. #ifdef CONFIG_RT2800PCI_PCI
  18. ret = pci_register_driver(&rt2800pci_driver);
  19. + if (ret) {
  20. +#ifdef CONFIG_RT2800PCI_WISOC
  21. + platform_driver_unregister(&rt2800soc_driver);
  22. +#endif
  23. + return ret;
  24. + }
  25. #endif
  26. +
  27. return ret;
  28. }