selinux: remove unneeded goto and its label
PATCH 1/1 selinux: remove unneeded goto and its label
Signed-off-by Kalevi Kolttonen <[email protected]>
--- security/selinux/avc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
security/selinux/avc.c +1 -2
@@ -497,7 +497,7 @@ static struct avc_node *avc_alloc_node(void) node =kmem_cache_zalloc (avc_node_cachep,GFP_NOWAIT );if (!node) - goto out; +return NULL ;INIT_HLIST_NODE (&node->list);avc_cache_stats_incr (allocations);
@@ -506,7 +506,6 @@ static struct avc_node *avc_alloc_node(void) selinux_avc.avc_cache_threshold)avc_reclaim_node (); -out:return node; }
Signature · 1 line
2.54.0
Stephen Smalley
maintainerQuoted 2 lines · Kalevi Kolttonen
Signed-off-by Kalevi Kolttonen <[email protected]>
As with the other patch, it is typical to include some kind of description in the body, and
the subject line could be improved, e.g.
selinux: drop unnecessary goto and label from avc_alloc_node()
Since avc_alloc_node() doesn't need to perform any cleanup on its exit paths, there is no
benefit to keeping the out label and goto statement. Drop it.
Quoted 29 lines
--- security/selinux/avc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)security/selinux/avc.c +1
-3@@ -497,7 +497,7 @@ static struct avc_node *avc_alloc_node(void) node =kmem_cache_zalloc (avc_node_cachep,GFP_NOWAIT );if (!node) - goto out; +return NULL ;INIT_HLIST_NODE (&node->list);avc_cache_stats_incr (allocations);@@ -506,7 +506,6 @@ static struct avc_node *avc_alloc_node(void) selinux_avc.avc_cache_threshold)avc_reclaim_node (); -out:return node; } --2.54.0