Hi tech@,
Happy new year!
I have some weird problems with my athn interface which drives me crazy.
1. Whenever I configure my athn as `media auto' for the first time it
correctly detects correct media subclass, but as soon as I select exact
same media subclass manually, it diverts to DS1 media subclass and after
that auto will not work again (I need to reboot system or my WiFi
provider aka my Android phone).
2. Sometimes my athn interface will reset all of a sudden and after
reset it diverts to DS1 media subclass again.
Anyway I decided to read athn related files, but I rarely understand the
code. My primary suspect was bad dynamic allocation usage, and I found
this:
/usr/src/sys/dev/ic/ar5008.c:676: free(rxq->bf, M_DEVBUF, 0);
/usr/src/sys/dev/ic/ar5008.c:677:
/usr/src/sys/dev/ic/ar5008.c:678: /* Free Rx descriptors. */
In this file almost after every free there is an explicit NULL
assignment but why there is no NULL assignment after this line?
===================================================================
RCS file: /home/cvs/src/sys/dev/ic/ar5008.c,v
retrieving revision 1.71
diff -u -p -r1.71 ar5008.c
--- ar5008.c 27 Dec 2022 20:13:03 -0000 1.71
+++ ar5008.c 1 Jan 2023 16:57:54 -0000
@@ -674,6 +674,7 @@ ar5008_rx_free(struct athn_softc *sc)
m_freem(bf->bf_m);
}
free(rxq->bf, M_DEVBUF, 0);
+ rxq->bf = NULL;
/* Free Rx descriptors. */
if (rxq->map != NULL) {