005-fix-mem-leak-on-unload.patch 779 B

12345678910111213141516171819202122232425262728293031
  1. From: George Kashperko <george@znau.edu.ua>
  2. Release nvram variables buffer.
  3. Prevent block reserved by alloc_etherdev from being freed.
  4. Signed-off-by: George Kashperko <george@znau.edu.ua>
  5. ---
  6. ---
  7. --- a/driver/siutils.c
  8. +++ b/driver/siutils.c
  9. @@ -647,7 +647,10 @@ si_detach(si_t *sih)
  10. #if !defined(BCMBUSTYPE) || (BCMBUSTYPE == SI_BUS)
  11. if (sii != &ksii)
  12. #endif /* !BCMBUSTYPE || (BCMBUSTYPE == SI_BUS) */
  13. - MFREE(sii->osh, sii, sizeof(si_info_t));
  14. + do {
  15. + MFREE(sii->osh, sii, sizeof(si_info_t));
  16. + nvram_exit((void *)&(sii->pub));
  17. + } while (0);
  18. }
  19. void *
  20. --- a/driver/wl_linux.c
  21. +++ b/driver/wl_linux.c
  22. @@ -1477,7 +1477,6 @@ wl_free_if(wl_info_t *wl, wl_if_t *wlif)
  23. free_netdev(wlif->dev);
  24. #endif
  25. }
  26. - MFREE(wl->osh, wlif, sizeof(wl_if_t));
  27. }
  28. #ifdef AP