NFSd: set nfsd_serv to NULL after service destruction
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Tue, 3 Jul 2012 12:46:41 +0000 (16:46 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:30:38 +0000 (10:30 -0700)
commitc717dcaf750cd0a43609d8c2016a380e542b28ed
tree8438f55fa48beb3c7ea276d03d8daa0f8f599127
parent6a4ebdb6be2ac2ad0e03ca9131573a1f0eadd7d5
NFSd: set nfsd_serv to NULL after service destruction

commit 57c8b13e3cd0f94944c9691ce7f58e5fcef8a12d upstream.

In nfsd_destroy():

if (destroy)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_server);

svc_shutdown_net(nfsd_serv, net) calls nfsd_last_thread(), which sets
nfsd_serv to NULL, causing a NULL dereference on the following line.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfsd.h
fs/nfsd/nfssvc.c