diff mbox series

[net-next,2/3] net: mctp: Don't use MCTP_INITIAL_DEFAULT_NET for a fallback net

Message ID 20241211-mctp-next-v1-2-e392f3d6d154@codeconstruct.com.au (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series net: mctp: MCTP core updates | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 32 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-12-11--15-00 (tests: 764)

Commit Message

Jeremy Kerr Dec. 11, 2024, 5:56 a.m. UTC
INITIAL_DEFAULT_NET is only the *initial* default; we should be using
the current value from mctp_default_net() instead.

Nothing is currently setting the default_net away from its initial
value, so no functional change at present.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
 net/mctp/af_mctp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index f6de136008f6f9b029e7dacc2e75dce1cd7fd075..87adb4b81ca3ee7d240c80a8a40c4a2e8a876075 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -353,7 +353,7 @@  static int mctp_getsockopt(struct socket *sock, int level, int optname,
 /* helpers for reading/writing the tag ioc, handling compatibility across the
  * two versions, and some basic API error checking
  */
-static int mctp_ioctl_tag_copy_from_user(unsigned long arg,
+static int mctp_ioctl_tag_copy_from_user(struct net *net, unsigned long arg,
 					 struct mctp_ioc_tag_ctl2 *ctl,
 					 bool tagv2)
 {
@@ -376,7 +376,7 @@  static int mctp_ioctl_tag_copy_from_user(unsigned long arg,
 
 	if (!tagv2) {
 		/* compat, using defaults for new fields */
-		ctl->net = MCTP_INITIAL_DEFAULT_NET;
+		ctl->net = mctp_default_net(net);
 		ctl->peer_addr = ctl_compat.peer_addr;
 		ctl->local_addr = MCTP_ADDR_ANY;
 		ctl->flags = ctl_compat.flags;
@@ -431,7 +431,7 @@  static int mctp_ioctl_alloctag(struct mctp_sock *msk, bool tagv2,
 	u8 tag;
 	int rc;
 
-	rc = mctp_ioctl_tag_copy_from_user(arg, &ctl, tagv2);
+	rc = mctp_ioctl_tag_copy_from_user(net, arg, &ctl, tagv2);
 	if (rc)
 		return rc;
 
@@ -475,7 +475,7 @@  static int mctp_ioctl_droptag(struct mctp_sock *msk, bool tagv2,
 	int rc;
 	u8 tag;
 
-	rc = mctp_ioctl_tag_copy_from_user(arg, &ctl, tagv2);
+	rc = mctp_ioctl_tag_copy_from_user(net, arg, &ctl, tagv2);
 	if (rc)
 		return rc;