X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-file.c;h=e826296e1339bb890f95c8d83c2b3a599e30d71e;hb=8cd246c3830733c2850cef049a7ad153daf0dd13;hp=b446916cd87ec9a7cd6b9816e6d5f3e3f732b01b;hpb=c9d14b39d262b076a160cc7533fad3c8ebfd7e79;p=palacios.git diff --git a/linux_module/iface-file.c b/linux_module/iface-file.c index b446916..e826296 100644 --- a/linux_module/iface-file.c +++ b/linux_module/iface-file.c @@ -161,7 +161,7 @@ static int palacios_file_mkdir(const char * pathname, unsigned short perms, int { dentry = kern_path_create(AT_FDCWD, pathname, &tmp_path, 1); - if (IS_ERR(dentry)) { + if (!dentry || IS_ERR(dentry)) { return 0; } @@ -170,7 +170,7 @@ static int palacios_file_mkdir(const char * pathname, unsigned short perms, int #endif - if (!IS_ERR(dentry)) { + if (!(!dentry || IS_ERR(dentry))) { ret = vfs_mkdir(path_ptr->dentry->d_inode, dentry, perms); } @@ -218,9 +218,9 @@ static void * palacios_file_open(const char * path, int mode, void * private_dat pfile->mode |= O_LARGEFILE; - pfile->filp = filp_open(path, pfile->mode, 0); + pfile->filp = filp_open(path, pfile->mode, 0600); // rw------- to start - if (IS_ERR(pfile->filp)) { + if (!pfile->filp || IS_ERR(pfile->filp)) { ERROR("Cannot open file: %s\n", path); palacios_free(pfile); return NULL;