Module Name:    src
Committed By:   rin
Date:           Fri Jul  5 04:34:35 UTC 2024

Modified Files:
        src/sys/net/npf: npf_handler.c

Log Message:
npf: Drop redundant NULL check before m_freem(9)

XXX
Their standalone version of m_freem() does not work for NULL input.
I will send pullreq to upstream soon.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/net/npf/npf_handler.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/npf/npf_handler.c
diff -u src/sys/net/npf/npf_handler.c:1.49 src/sys/net/npf/npf_handler.c:1.50
--- src/sys/net/npf/npf_handler.c:1.49	Sat May 30 14:16:56 2020
+++ src/sys/net/npf/npf_handler.c	Fri Jul  5 04:34:35 2024
@@ -46,7 +46,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_handler.c,v 1.49 2020/05/30 14:16:56 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_handler.c,v 1.50 2024/07/05 04:34:35 rin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -328,10 +328,8 @@ out:
 		error = ENETUNREACH;
 	}
 
-	if (*mp) {
-		/* Free the mbuf chain. */
-		m_freem(*mp);
-		*mp = NULL;
-	}
+	/* Free the mbuf chain. */
+	m_freem(*mp);
+	*mp = NULL;
 	return error;
 }

Reply via email to