aboutsummaryrefslogtreecommitdiffstats
path: root/module/splat
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-02-18 10:16:26 -0800
committerBrian Behlendorf <[email protected]>2009-02-18 10:16:26 -0800
commit63a93055fb6cfddebe31c791f7df86b14942ca9d (patch)
tree69973cae3360a187eab75a9f7eca8e47442b2a32 /module/splat
parent02c7f164946e86048721a8c1af6ada3f25c3a78c (diff)
Coverity 9657: Resource Leak
Accidentally leaked list item li in error path. The fix is to adjust this error path to ensure the allocated list item which has not yet been added to the list gets freed. To do this we simply add a new goto label slightly earlier to use the existing cleanup logic and minimize the number of unique return points.
Diffstat (limited to 'module/splat')
-rw-r--r--module/splat/splat-list.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/splat/splat-list.c b/module/splat/splat-list.c
index 464a45781..5a610cee4 100644
--- a/module/splat/splat-list.c
+++ b/module/splat/splat-list.c
@@ -380,7 +380,7 @@ splat_list_test7(struct file *file, void *arg)
"list node should inactive %p/%p\n",
li->li_node.prev, li->li_node.next);
rc = -EINVAL;
- goto out;
+ goto out_li;
}
/* Validate node is active when linked in to a list */
@@ -403,7 +403,7 @@ splat_list_test7(struct file *file, void *arg)
li->li_node.prev, li->li_node.next);
rc = -EINVAL;
}
-
+out_li:
kmem_free(li, sizeof(list_item_t));
out:
/* Remove all items */