Commit c1c9a3c9 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller
Browse files

net: remove unnecessary genlmsg_cancel() calls



the message be freed immediately, no need to trim it
back to the previous size.

Inspired by commit 7a9b3ec1 ("nl80211: remove unnecessary genlmsg_cancel() calls")

Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 77ab8d5d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2426,7 +2426,6 @@ send_done:
nla_put_failure:
	err = -EMSGSIZE;
errout:
	genlmsg_cancel(skb, hdr);
	nlmsg_free(skb);
	return err;
}
@@ -2720,7 +2719,6 @@ send_done:
nla_put_failure:
	err = -EMSGSIZE;
errout:
	genlmsg_cancel(skb, hdr);
	nlmsg_free(skb);
	return err;
}
+0 −1
Original line number Diff line number Diff line
@@ -2514,7 +2514,6 @@ static void hwsim_mcast_new_radio(int id, struct genl_info *info,
	return;

out_err:
	genlmsg_cancel(mcast_skb, data);
	nlmsg_free(mcast_skb);
}

+0 −4
Original line number Diff line number Diff line
@@ -1826,7 +1826,6 @@ send_done:
nla_put_failure:
	err = -EMSGSIZE;
err_table_put:
	genlmsg_cancel(skb, hdr);
	nlmsg_free(skb);
	return err;
}
@@ -2032,7 +2031,6 @@ int devlink_dpipe_entry_ctx_prepare(struct devlink_dpipe_dump_ctx *dump_ctx)
	return 0;

nla_put_failure:
	genlmsg_cancel(dump_ctx->skb, dump_ctx->hdr);
	nlmsg_free(dump_ctx->skb);
	return -EMSGSIZE;
}
@@ -2249,7 +2247,6 @@ send_done:
nla_put_failure:
	err = -EMSGSIZE;
err_table_put:
	genlmsg_cancel(skb, hdr);
	nlmsg_free(skb);
	return err;
}
@@ -2551,7 +2548,6 @@ nla_put_failure:
	err = -EMSGSIZE;
err_resource_put:
err_skb_send_alloc:
	genlmsg_cancel(skb, hdr);
	nlmsg_free(skb);
	return err;
}
+0 −1
Original line number Diff line number Diff line
@@ -226,7 +226,6 @@ static int seg6_genl_get_tunsrc(struct sk_buff *skb, struct genl_info *info)

nla_put_failure:
	rcu_read_unlock();
	genlmsg_cancel(msg, hdr);
free_msg:
	nlmsg_free(msg);
	return -ENOMEM;
+0 −1
Original line number Diff line number Diff line
@@ -201,7 +201,6 @@ static int ncsi_pkg_info_nl(struct sk_buff *msg, struct genl_info *info)
	return genlmsg_reply(skb, info);

err:
	genlmsg_cancel(skb, hdr);
	kfree_skb(skb);
	return rc;
}
Loading