Ticket #9576: 006-fix-mem-leak-on-unload.patch

File 006-fix-mem-leak-on-unload.patch, 973 bytes (added by gkashperko, 5 years ago)

bug fix

  • driver/siutils.c

    From: George Kashperko <george@znau.edu.ua>
    
    Release nvram variables buffer.
    Prevent block reserved by alloc_etherdev from being freed.
    Signed-off-by: George Kashperko <george@znau.edu.ua>
    ---
    ---
    old new si_detach(si_t *sih) 
    647647#if !defined(BCMBUSTYPE) || (BCMBUSTYPE == SI_BUS) 
    648648        if (sii != &ksii) 
    649649#endif  /* !BCMBUSTYPE || (BCMBUSTYPE == SI_BUS) */ 
    650                 MFREE(sii->osh, sii, sizeof(si_info_t)); 
     650                do { 
     651                        MFREE(sii->osh, sii, sizeof(si_info_t)); 
     652                        nvram_exit((void *)&(sii->pub)); 
     653                } while (0); 
    651654} 
    652655 
    653656void * 
  • driver/wl_linux.c

    old new wl_free_if(wl_info_t *wl, wl_if_t *wlif) 
    14781478                free_netdev(wlif->dev); 
    14791479#endif 
    14801480        } 
    1481         MFREE(wl->osh, wlif, sizeof(wl_if_t)); 
    14821481} 
    14831482 
    14841483#ifdef AP