diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-01-24 03:39:22 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-01-24 11:37:19 -0500 |
commit | 803ab977618eae2b292cda0a97eed75f42250ddf (patch) | |
tree | 846b9d4086148ea91c440dde2b8ef5131ce6ecc2 /fs | |
parent | c1aab02dac690af7ff634d8e1cb3be6a04387eef (diff) |
cifs: NULL dereference on allocation failure
We should just return directly here, the goto causes a NULL dereference.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/connect.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 986709a8d903..026d6464335b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -3857,10 +3857,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) | |||
3857 | struct smb_vol *vol_info; | 3857 | struct smb_vol *vol_info; |
3858 | 3858 | ||
3859 | vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL); | 3859 | vol_info = kzalloc(sizeof(*vol_info), GFP_KERNEL); |
3860 | if (vol_info == NULL) { | 3860 | if (vol_info == NULL) |
3861 | tcon = ERR_PTR(-ENOMEM); | 3861 | return ERR_PTR(-ENOMEM); |
3862 | goto out; | ||
3863 | } | ||
3864 | 3862 | ||
3865 | vol_info->local_nls = cifs_sb->local_nls; | 3863 | vol_info->local_nls = cifs_sb->local_nls; |
3866 | vol_info->linux_uid = fsuid; | 3864 | vol_info->linux_uid = fsuid; |