file->f_dentry need to be check ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

In some functions, like vfs_readdir (in fs/readdir.c), there is this kind of code :
struct inode *inode = file->f_dentry->d_inode;
file is a given parameter.
So if f_dentry is NULL there is a bug. But can f_dentry be null on an opened file ?
If the file is deleted before it could be. But I'm not sure that's why I post this notre here :)
Maybe we should correct it whith this :


struct inode *inode ;

if(!file->f_dentry)
	goto out ;

inode = file->f_dentry->d_inode ;



But I'm paranoiac :)

Ciao


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux