]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sunrpc/svc.c
svcrpc: fix double-free on shutdown of nfsd after changing pool mode
[karo-tx-linux.git] / net / sunrpc / svc.c
index 952f206ff307a42b8a7bb20066dcf6ed5e3ab2c9..e664aa5cf41072e4418e3ec0b3dcc87568724e2f 100644 (file)
@@ -166,6 +166,7 @@ svc_pool_map_alloc_arrays(struct svc_pool_map *m, unsigned int maxpools)
 
 fail_free:
        kfree(m->to_pool);
+       m->to_pool = NULL;
 fail:
        return -ENOMEM;
 }
@@ -286,7 +287,9 @@ svc_pool_map_put(void)
        if (!--m->count) {
                m->mode = SVC_POOL_DEFAULT;
                kfree(m->to_pool);
+               m->to_pool = NULL;
                kfree(m->pool_to);
+               m->pool_to = NULL;
                m->npools = 0;
        }