|
@@ -1680,8 +1680,10 @@ start_again:
|
|
|
|
|
|
hdr = genlmsg_put(skb, info->snd_portid, info->snd_seq,
|
|
|
&devlink_nl_family, NLM_F_MULTI, cmd);
|
|
|
- if (!hdr)
|
|
|
+ if (!hdr) {
|
|
|
+ nlmsg_free(skb);
|
|
|
return -EMSGSIZE;
|
|
|
+ }
|
|
|
|
|
|
if (devlink_nl_put_handle(skb, devlink))
|
|
|
goto nla_put_failure;
|
|
@@ -2098,8 +2100,10 @@ start_again:
|
|
|
|
|
|
hdr = genlmsg_put(skb, info->snd_portid, info->snd_seq,
|
|
|
&devlink_nl_family, NLM_F_MULTI, cmd);
|
|
|
- if (!hdr)
|
|
|
+ if (!hdr) {
|
|
|
+ nlmsg_free(skb);
|
|
|
return -EMSGSIZE;
|
|
|
+ }
|
|
|
|
|
|
if (devlink_nl_put_handle(skb, devlink))
|
|
|
goto nla_put_failure;
|