PERFORCE change 28930 for review

Robert Watson rwatson at FreeBSD.org
Mon Apr 14 15:41:48 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=28930

Change 28930 by rwatson at rwatson_tislabs on 2003/04/14 08:41:17

	When initializing mbuf label storage, don't store the error
	value: we'll never do anything with it, and it makes for
	additional diffs and ifdefs.
	
	Pointed out by:		sam

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#32 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/subr_mbuf.c#32 (text+ko) ====

@@ -1301,16 +1301,12 @@
 m_gethdr(int how, short type)
 {
 	struct mbuf *mb;
-#ifdef MAC
-	int error;
-#endif
 
 	mb = (struct mbuf *)mb_alloc(&mb_list_mbuf, how, type, 0, NULL);
 	if (mb != NULL) {
 		_mbhdr_setup(mb, type);
 #ifdef MAC
-		error = mac_init_mbuf(mb, MBTOM(how));
-		if (error) {
+		if (mac_init_mbuf(mb, MBTOM(how)) != 0) {
 			m_free(mb);
 			return (NULL);
 		}
@@ -1354,16 +1350,12 @@
 m_gethdr_clrd(int  how, short type)
 {
 	struct mbuf *mb;
-#ifdef MAC
-	int error;
-#endif
 
 	mb = (struct mbuf *)mb_alloc(&mb_list_mbuf, how, type, 0, NULL);
 	if (mb != NULL) {
 		_mbhdr_setup(mb, type);
 #ifdef MAC
-		error = mac_init_mbuf(mb, MBTOM(how));
-		if (error) {
+		if (mac_init_mbuf(mb, MBTOM(how)) != 0) {
 			m_free(mb);
 			return (NULL);
 		}
@@ -1474,9 +1466,6 @@
 m_getcl(int how, short type, int flags)
 {
 	struct mbuf *mb;
-#ifdef MAC
-	int error;
-#endif
 	int cchnum;
 
 	mb = (struct mbuf *)mb_alloc(&mb_list_mbuf, how, type,
@@ -1504,8 +1493,7 @@
 	}
 #ifdef MAC
 	if (flags & M_PKTHDR) {
-		error = mac_init_mbuf(mb, MBTOM(how));
-		if (error) {
+		if (mac_init_mbuf(mb, MBTOM(how)) != 0) {
 			m_free(mb);
 			return (NULL);
 		}
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list