diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-07-03 16:46:41 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-02 10:30:38 -0700 |
commit | c717dcaf750cd0a43609d8c2016a380e542b28ed (patch) | |
tree | 8438f55fa48beb3c7ea276d03d8daa0f8f599127 /fs/nfsd/nfsd.h | |
parent | 6a4ebdb6be2ac2ad0e03ca9131573a1f0eadd7d5 (diff) | |
download | lwn-c717dcaf750cd0a43609d8c2016a380e542b28ed.tar.gz lwn-c717dcaf750cd0a43609d8c2016a380e542b28ed.zip |
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>
Diffstat (limited to 'fs/nfsd/nfsd.h')
-rw-r--r-- | fs/nfsd/nfsd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index e3339ca2b65c..1336a6512cdc 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -80,6 +80,8 @@ static inline void nfsd_destroy(struct net *net) if (destroy) svc_shutdown_net(nfsd_serv, net); svc_destroy(nfsd_serv); + if (destroy) + nfsd_serv = NULL; } #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) |