X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-file.c;h=78c4e0b901448b2d1996bacef83f184cbf148656;hb=0b2115047303e779be8578e9802cfa55d1767c7b;hp=b446916cd87ec9a7cd6b9816e6d5f3e3f732b01b;hpb=ae17be15b87687b72162680b335d64b741d0bb6b;p=palacios.git diff --git a/linux_module/iface-file.c b/linux_module/iface-file.c index b446916..78c4e0b 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); } @@ -220,7 +220,7 @@ static void * palacios_file_open(const char * path, int mode, void * private_dat pfile->filp = filp_open(path, pfile->mode, 0); - if (IS_ERR(pfile->filp)) { + if (!pfile->filp || IS_ERR(pfile->filp)) { ERROR("Cannot open file: %s\n", path); palacios_free(pfile); return NULL;