diff options
author | davide <davide@FreeBSD.org> | 2012-10-25 20:23:04 +0000 |
---|---|---|
committer | davide <davide@FreeBSD.org> | 2012-10-25 20:23:04 +0000 |
commit | bac20b679d394666359241df51cd79eab738bc5a (patch) | |
tree | 80353a474646ca0a147c238f3a413986b57177bd /sys/fs/smbfs/smbfs_smb.c | |
parent | 7a91df3c3792dc1bed5ff818447fc26896d809d1 (diff) | |
download | FreeBSD-src-bac20b679d394666359241df51cd79eab738bc5a.zip FreeBSD-src-bac20b679d394666359241df51cd79eab738bc5a.tar.gz |
- Remove the references to the deprecated zalloc kernel interface
- Use M_ZERO flag in malloc() rather than bzero()
- malloc() with M_NOWAIT can't return NULL so there's no need to check
Reviewed by: alc
Approved by: alc
Diffstat (limited to 'sys/fs/smbfs/smbfs_smb.c')
-rw-r--r-- | sys/fs/smbfs/smbfs_smb.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c index 05162d5..7b84f4b 100644 --- a/sys/fs/smbfs/smbfs_smb.c +++ b/sys/fs/smbfs/smbfs_smb.c @@ -1165,8 +1165,6 @@ smbfs_findopenLM2(struct smbfs_fctx *ctx, struct smbnode *dnp, ctx->f_name = malloc(SMB_MAXFNAMELEN * 2, M_SMBFSDATA, M_WAITOK); } else ctx->f_name = malloc(SMB_MAXFNAMELEN, M_SMBFSDATA, M_WAITOK); - if (ctx->f_name == NULL) - return ENOMEM; ctx->f_infolevel = SMB_DIALECT(SSTOVC(ctx->f_ssp)) < SMB_DIALECT_NTLM0_12 ? SMB_INFO_STANDARD : SMB_FIND_FILE_DIRECTORY_INFO; ctx->f_attrmask = attr; @@ -1311,10 +1309,7 @@ smbfs_findopen(struct smbnode *dnp, const char *wildcard, int wclen, int attr, struct smbfs_fctx *ctx; int error; - ctx = malloc(sizeof(*ctx), M_SMBFSDATA, M_WAITOK); - if (ctx == NULL) - return ENOMEM; - bzero(ctx, sizeof(*ctx)); + ctx = malloc(sizeof(*ctx), M_SMBFSDATA, M_WAITOK | M_ZERO); ctx->f_ssp = dnp->n_mount->sm_share; ctx->f_dnp = dnp; ctx->f_flags = SMBFS_RDD_FINDFIRST; |