Save a bzero() by using M_ZERO.
Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb) MFC after: 2 weeks
This commit is contained in:
parent
2aff415a8c
commit
9ce63ce2a3
@ -223,7 +223,7 @@ smbfs_node_alloc(struct mount *mp, struct vnode *dvp,
|
||||
if (fap == NULL)
|
||||
return ENOENT;
|
||||
|
||||
np = malloc(sizeof *np, M_SMBNODE, M_WAITOK);
|
||||
np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO);
|
||||
error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp);
|
||||
if (error) {
|
||||
free(np, M_SMBNODE);
|
||||
@ -235,7 +235,6 @@ smbfs_node_alloc(struct mount *mp, struct vnode *dvp,
|
||||
return (error);
|
||||
}
|
||||
vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG;
|
||||
bzero(np, sizeof(*np));
|
||||
vp->v_data = np;
|
||||
np->n_vnode = vp;
|
||||
np->n_mount = VFSTOSMBFS(mp);
|
||||
|
Loading…
Reference in New Issue
Block a user