diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index b81149eb26e5..521d1dcb4cf0 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1638,10 +1638,9 @@ static struct super_block *nfs_get_sb(struct file_system_type *fs_type, | |||
1638 | #endif /* CONFIG_NFS_V3 */ | 1638 | #endif /* CONFIG_NFS_V3 */ |
1639 | 1639 | ||
1640 | s = ERR_PTR(-ENOMEM); | 1640 | s = ERR_PTR(-ENOMEM); |
1641 | server = kmalloc(sizeof(struct nfs_server), GFP_KERNEL); | 1641 | server = kzalloc(sizeof(struct nfs_server), GFP_KERNEL); |
1642 | if (!server) | 1642 | if (!server) |
1643 | goto out_err; | 1643 | goto out_err; |
1644 | memset(server, 0, sizeof(struct nfs_server)); | ||
1645 | /* Zero out the NFS state stuff */ | 1644 | /* Zero out the NFS state stuff */ |
1646 | init_nfsv4_state(server); | 1645 | init_nfsv4_state(server); |
1647 | server->client = server->client_sys = server->client_acl = ERR_PTR(-EINVAL); | 1646 | server->client = server->client_sys = server->client_acl = ERR_PTR(-EINVAL); |
@@ -1942,10 +1941,9 @@ static struct super_block *nfs4_get_sb(struct file_system_type *fs_type, | |||
1942 | return ERR_PTR(-EINVAL); | 1941 | return ERR_PTR(-EINVAL); |
1943 | } | 1942 | } |
1944 | 1943 | ||
1945 | server = kmalloc(sizeof(struct nfs_server), GFP_KERNEL); | 1944 | server = kzalloc(sizeof(struct nfs_server), GFP_KERNEL); |
1946 | if (!server) | 1945 | if (!server) |
1947 | return ERR_PTR(-ENOMEM); | 1946 | return ERR_PTR(-ENOMEM); |
1948 | memset(server, 0, sizeof(struct nfs_server)); | ||
1949 | /* Zero out the NFS state stuff */ | 1947 | /* Zero out the NFS state stuff */ |
1950 | init_nfsv4_state(server); | 1948 | init_nfsv4_state(server); |
1951 | server->client = server->client_sys = server->client_acl = ERR_PTR(-EINVAL); | 1949 | server->client = server->client_sys = server->client_acl = ERR_PTR(-EINVAL); |