Skip to content
Snippets Groups Projects
Commit 0b778076 authored by Shengzhe Zhao's avatar Shengzhe Zhao Committed by Iliyan Malchev
Browse files

vfs: check if f_count is 0 or negative


filp_close is using !file_count(filp) to check if f_count is 0. if it is
0, filp_close think it is a closed file then will return. However, for a
closed file, f_count could be reduced to -1, then !file_count(filp) is
false, filp_close will proceed to handle this file then could panic.
This change will check if f_count is 0 or negative instead of only
checking 0 to avoid panic.

b/18200219 LRX21M: kernel_panic

Change-Id: I5117853dcbebec399021abf34338b1f6aff6ad14
Signed-off-by: default avatarShengzhe Zhao <a18689@motorola.com>
Reviewed-by: default avatarYi-Wei Zhao <gbjc64@motorola.com>
Signed-off-by: default avatarIliyan Malchev <malchev@google.com>
parent a7a5f36f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment