net/hsr: Fix possible leak in 'hsr_get_node_status()'
Subsystems (3)
PATCH 1/1 net/hsr: Fix possible leak in 'hsr_get_node_status()'
If 'hsr_get_node_data()' returns error, going directly to 'fail' label doesn't free the memory pointed by 'skb_out'.
Signed-off-by Geyslan G. Bem <[email protected]>
--- net/hsr/hsr_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/hsr/hsr_netlink.c +1 -1
@@ -249,7 +249,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) &hsr_node_if2_age, &hsr_node_if2_seq);if (res <0 ) - goto fail; + goto nla_put_failure; res =nla_put (skb_out,HSR_A_NODE_ADDR ,ETH_ALEN ,nla_data (info->attrs[HSR_A_NODE_ADDR ]));
Signature · 1 line
1.8.4.2
2013/11/14 Geyslan G. Bem <[email protected]>:
Quoted 22 lines
If '
hsr_get_node_data()' returns error, going directly to 'fail' label doesn't free the memory pointed by 'skb_out'.Signed-off-by Geyslan G. Bem <[email protected]>--- net/hsr/hsr_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/hsr/hsr_netlink.c +1
-2@@ -249,7 +249,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) &hsr_node_if2_age, &hsr_node_if2_seq);if (res <0 ) - goto fail; + goto nla_put_failure; res =nla_put (skb_out,HSR_A_NODE_ADDR ,ETH_ALEN ,nla_data (info->attrs[HSR_A_NODE_ADDR ])); --
Quoted 2 lines
1.8.4.2
It's a Coverity catch: CID 1128855.
Signature · 4 lines
Regards, Geyslan G. Bem hackingbits.com
David Miller
maintainerFrom: "Geyslan G. Bem" <[email protected]>
Date: Thu, 14 Nov 2013 16:12:54 -0300
Quoted 4 lines
If '
hsr_get_node_data()' returns error, going directly to 'fail' label doesn't free the memory pointed by 'skb_out'.Signed-off-by Geyslan G. Bem <[email protected]>
Looks good, applied, thanks!