Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106131876
D6819.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6819.diff
View Options
Index: head/sys/dev/iwm/if_iwm.c
===================================================================
--- head/sys/dev/iwm/if_iwm.c
+++ head/sys/dev/iwm/if_iwm.c
@@ -5014,6 +5014,8 @@
if (do_net80211)
ieee80211_ifdetach(&sc->sc_ic);
+ iwm_phy_db_free(sc);
+
/* Free descriptor rings */
iwm_free_rx_ring(sc, &sc->rxq);
for (i = 0; i < nitems(sc->txq); i++)
Index: head/sys/dev/iwm/if_iwm_phy_db.h
===================================================================
--- head/sys/dev/iwm/if_iwm_phy_db.h
+++ head/sys/dev/iwm/if_iwm_phy_db.h
@@ -109,4 +109,5 @@
extern int iwm_phy_db_set_section(struct iwm_softc *sc,
struct iwm_calib_res_notif_phy_db *phy_db_notif);
extern int iwm_send_phy_db_data(struct iwm_softc *sc);
+extern void iwm_phy_db_free(struct iwm_softc *sc);
#endif /* __IF_IWM_PHY_DB_H__ */
Index: head/sys/dev/iwm/if_iwm_phy_db.c
===================================================================
--- head/sys/dev/iwm/if_iwm_phy_db.c
+++ head/sys/dev/iwm/if_iwm_phy_db.c
@@ -451,3 +451,33 @@
__func__);
return 0;
}
+
+static void
+iwm_phy_db_free_section(struct iwm_softc *sc,
+ enum iwm_phy_db_section_type type, uint16_t chg_id)
+{
+ struct iwm_phy_db_entry *entry =
+ iwm_phy_db_get_section(sc, type, chg_id);
+ if (!entry)
+ return;
+
+ if (entry->data != NULL)
+ free(entry->data, M_DEVBUF);
+ entry->data = NULL;
+ entry->size = 0;
+}
+
+void
+iwm_phy_db_free(struct iwm_softc *sc)
+{
+ int i;
+
+ iwm_phy_db_free_section(sc, IWM_PHY_DB_CFG, 0);
+ iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_NCH, 0);
+
+ for (i = 0; i < IWM_NUM_PAPD_CH_GROUPS; i++)
+ iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_PAPD, i);
+
+ for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++)
+ iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_TXP, i);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 10:32 PM (11 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15608429
Default Alt Text
D6819.diff (1 KB)
Attached To
Mode
D6819: [iwm] Add and use iwm_phy_db_free(), to plug phy_db memory leak.
Attached
Detach File
Event Timeline
Log In to Comment