diff options
-rw-r--r-- | net/core/devlink.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index b0b87a292e7c..a0adfc31a3fe 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c | |||
@@ -1680,8 +1680,10 @@ start_again: | |||
1680 | 1680 | ||
1681 | hdr = genlmsg_put(skb, info->snd_portid, info->snd_seq, | 1681 | hdr = genlmsg_put(skb, info->snd_portid, info->snd_seq, |
1682 | &devlink_nl_family, NLM_F_MULTI, cmd); | 1682 | &devlink_nl_family, NLM_F_MULTI, cmd); |
1683 | if (!hdr) | 1683 | if (!hdr) { |
1684 | nlmsg_free(skb); | ||
1684 | return -EMSGSIZE; | 1685 | return -EMSGSIZE; |
1686 | } | ||
1685 | 1687 | ||
1686 | if (devlink_nl_put_handle(skb, devlink)) | 1688 | if (devlink_nl_put_handle(skb, devlink)) |
1687 | goto nla_put_failure; | 1689 | goto nla_put_failure; |
@@ -2098,8 +2100,10 @@ start_again: | |||
2098 | 2100 | ||
2099 | hdr = genlmsg_put(skb, info->snd_portid, info->snd_seq, | 2101 | hdr = genlmsg_put(skb, info->snd_portid, info->snd_seq, |
2100 | &devlink_nl_family, NLM_F_MULTI, cmd); | 2102 | &devlink_nl_family, NLM_F_MULTI, cmd); |
2101 | if (!hdr) | 2103 | if (!hdr) { |
2104 | nlmsg_free(skb); | ||
2102 | return -EMSGSIZE; | 2105 | return -EMSGSIZE; |
2106 | } | ||
2103 | 2107 | ||
2104 | if (devlink_nl_put_handle(skb, devlink)) | 2108 | if (devlink_nl_put_handle(skb, devlink)) |
2105 | goto nla_put_failure; | 2109 | goto nla_put_failure; |