Commit dbc2f102 authored by Steve French's avatar Steve French Committed by Steve French

Add 2 missing kmalloc failure checks during cifs mount time

Signed-off-by: default avatarYury Umanets <torque@ukrpost.net>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent f2ba8b3c
...@@ -23,6 +23,7 @@ Amrut Joshi ...@@ -23,6 +23,7 @@ Amrut Joshi
Shobhit Dayal Shobhit Dayal
Sergey Vlasov Sergey Vlasov
Richard Hughes Richard Hughes
Yury Umanets
Test case and Bug Report contributors Test case and Bug Report contributors
------------------------------------- -------------------------------------
......
...@@ -610,6 +610,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol ...@@ -610,6 +610,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
} }
if ((temp_len = strnlen(value, 300)) < 300) { if ((temp_len = strnlen(value, 300)) < 300) {
vol->UNC = kmalloc(temp_len+1,GFP_KERNEL); vol->UNC = kmalloc(temp_len+1,GFP_KERNEL);
if(vol->UNC == NULL)
return 1;
strcpy(vol->UNC,value); strcpy(vol->UNC,value);
if (strncmp(vol->UNC, "//", 2) == 0) { if (strncmp(vol->UNC, "//", 2) == 0) {
vol->UNC[0] = '\\'; vol->UNC[0] = '\\';
...@@ -757,6 +759,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol ...@@ -757,6 +759,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
} }
if ((temp_len = strnlen(devname, 300)) < 300) { if ((temp_len = strnlen(devname, 300)) < 300) {
vol->UNC = kmalloc(temp_len+1,GFP_KERNEL); vol->UNC = kmalloc(temp_len+1,GFP_KERNEL);
if(vol->UNC == NULL)
return 1;
strcpy(vol->UNC,devname); strcpy(vol->UNC,devname);
if (strncmp(vol->UNC, "//", 2) == 0) { if (strncmp(vol->UNC, "//", 2) == 0) {
vol->UNC[0] = '\\'; vol->UNC[0] = '\\';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment