• Robert Schmidt's avatar
    Correct nr_clear_ra_proc() for SA+NSA case, fix memory leak · b12d3a4f
    Robert Schmidt authored
    In NSA, the RA process contains the RNTI of the UE to add. The previous
    implementation would not remove the RNTI in NSA/for CFRA, which is
    unclear (why should it stay? RA is over). Also, we did not clear all
    contents, which masked a bug, as we were reusing an RA process for a
    subsequent attach, leading to a segfault on reattach. That is fixed in
    this commit.
    
    Also, we were using the RA structure after having cleared it in
    _nr_rx_sdu(), which semantically makes no sense.
    
    To harmonize handling of the preambles: completely reset the RA
    processes inside nr_clear_ra_proc(). For SA, also add the initialization
    of allowed preambles.
    
    Finally, this commit fixes a memory leak: we always (also in SA) fill a
    list of preambles in a dynamically allocated preamble list. Since the
    total list is only up to 64 preambles of 1B each, put it directly into
    the struct instead of dynamically allocating it.
    b12d3a4f
nr_mac_gNB.h 25.6 KB