vfs: refcount file structs used in fdescs
This commit is contained in:
parent
744c3b266f
commit
02c0a70a30
5 changed files with 22 additions and 4 deletions
1
fs/vfs.c
1
fs/vfs.c
|
|
@ -65,6 +65,7 @@ struct file *vfs_open(const char *pathname, int *err)
|
|||
{
|
||||
/* allocate a file */
|
||||
struct file *file = slab_alloc(file_slab);
|
||||
|
||||
if (!file) {
|
||||
kprintf(LOG_ERROR "Failed to allocate file struct\n");
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue