Skip to content

Commit

Permalink
Fix potential null pointer dereference (#274)
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
  • Loading branch information
mmkayPL authored Aug 3, 2020
1 parent b3508e8 commit 653936b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/kernel/trace_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ static void _fsm_init(iotrace_inode_tracer_t inode_tracer) {

/* Allocate FS monitor */
fsm = kzalloc(sizeof(*fsm), GFP_KERNEL);
if (!fsm) {
goto ERROR;
}
refcount_set(&fsm->refcnt, 1);

/* Allocate FS notify group for receiving fs events */
Expand All @@ -454,6 +457,9 @@ static void _fsm_init(iotrace_inode_tracer_t inode_tracer) {
BUG_ON(fsm->group->private);

priv = kzalloc(sizeof(struct iotrace_group_priv), GFP_KERNEL);
if (!priv) {
goto ERROR;
}
priv->fsm = fsm;
priv->mark_cache = kmem_cache_create(
"fsmark_cache", sizeof(struct fsnotify_mark), 0, 0, NULL);
Expand Down

0 comments on commit 653936b

Please sign in to comment.