diff options
author | Nikolay Borisov <[email protected]> | 2016-06-29 09:46:41 +0300 |
---|---|---|
committer | David Sterba <[email protected]> | 2016-07-26 13:52:25 +0200 |
commit | 3d48d9810de4ee1bca4a1c905efd0618944904cd (patch) | |
tree | 1bdd8f5dd630aa97d03bd17cda4049d84335eebc /lib/cpu-notifier-error-inject.c | |
parent | fb770ae414d018255afa7a70b14ba1f8620762dd (diff) |
btrfs: Handle uninitialised inode eviction
The code flow in btrfs_new_inode allows for btrfs_evict_inode to be
called with not fully initialised inode (e.g. ->root member not
being set). This can happen when btrfs_set_inode_index in
btrfs_new_inode fails, which in turn would call iput for the newly
allocated inode. This in turn leads to vfs calling into btrfs_evict_inode.
This leads to null pointer dereference. To handle this situation check whether
the passed inode has root set and just free it in case it doesn't.
Signed-off-by: Nikolay Borisov <[email protected]>
Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions