diff options
author | Robert Mustacchi <rm@fingolfin.org> | 2021-11-12 08:50:12 -0800 |
---|---|---|
committer | Robert Mustacchi <rm@fingolfin.org> | 2022-01-15 18:40:54 +0000 |
commit | e0cd43fe10732fee98e49dcb194f13ded2d5b660 (patch) | |
tree | 3121bdb0dcf634122bea6ccae27bcbf789476cb1 /usr/src | |
parent | 7a58f53801acca2cd594b9ecb75bf926e4fb3eda (diff) | |
download | illumos-gate-e0cd43fe10732fee98e49dcb194f13ded2d5b660.tar.gz |
14365 memlist_insert() throws memlists away with empty lists
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/os/memlist_new.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/memlist_new.c b/usr/src/uts/common/os/memlist_new.c index adef7cb015..eaa23ed24e 100644 --- a/usr/src/uts/common/os/memlist_new.c +++ b/usr/src/uts/common/os/memlist_new.c @@ -143,13 +143,17 @@ memlist_insert( } new->ml_next = NULL; new->ml_prev = last; - if (last != NULL) + if (last != NULL) { last->ml_next = new; + } else { + ASSERT3P(*curmemlistp, ==, NULL); + *curmemlistp = new; + } } void memlist_del(struct memlist *memlistp, - struct memlist **curmemlistp) + struct memlist **curmemlistp) { #ifdef DEBUG /* |