Add missing error handling to this case where a memory allocation fails.

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@170 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
behlendo 2008-11-04 22:51:31 +00:00
parent 8e80a04c04
commit 3bc9d50eaa
1 changed files with 7 additions and 2 deletions

View File

@ -40,10 +40,15 @@ kobj_open_file(const char *name)
int rc; int rc;
ENTRY; ENTRY;
if ((rc = vn_open(name, UIO_SYSSPACE, FREAD, 0644, &vp, 0, 0))) file = kmalloc(sizeof(_buf_t), GFP_KERNEL);
if (file == NULL)
RETURN((_buf_t *)-1UL); RETURN((_buf_t *)-1UL);
file = kmalloc(sizeof(_buf_t), GFP_KERNEL); if ((rc = vn_open(name, UIO_SYSSPACE, FREAD, 0644, &vp, 0, 0))) {
kfree(file);
RETURN((_buf_t *)-1UL);
}
file->vp = vp; file->vp = vp;
RETURN(file); RETURN(file);