diff --git a/fs/inode/fs_filedetach.c b/fs/inode/fs_filedetach.c index ff71d5f2d9f..601e9da2ccd 100644 --- a/fs/inode/fs_filedetach.c +++ b/fs/inode/fs_filedetach.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/inode/fs_filedetach.c * - * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -114,6 +114,8 @@ int file_detach(int fd, FAR struct file *filep) FAR struct filelist *list; FAR struct file *parent; + DEBUGASSERT(filep != NULL); + /* Verify the file descriptor range */ if (fd < 0 || fd >= CONFIG_NFILE_DESCRIPTORS) diff --git a/fs/inode/fs_fileopen.c b/fs/inode/fs_fileopen.c index 08f2ab82291..df8b12253bb 100644 --- a/fs/inode/fs_fileopen.c +++ b/fs/inode/fs_fileopen.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/inode/fs_fileopen.c * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Copyright (C) 2018-2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -78,6 +78,8 @@ int file_open(FAR struct file *filep, FAR const char *path, int oflags, ...) int ret; int fd; + DEBUGASSERT(filep != NULL && path != NULL); + /* At present, this is just a placeholder. It is just a wrapper around * nx_open() followed by a called to file_detach(). Ideally, this should * a native open function that opens the VFS node directly without using