Module Name:    src
Committed By:   martin
Date:           Tue May 14 11:37:13 UTC 2019

Modified Files:
        src/sys/net [netbsd-8]: if_media.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1266):

        sys/net/if_media.c: revision 1.42 (via patch)

Add missing error check.


To generate a diff of this commit:
cvs rdiff -u -r1.32.6.2 -r1.32.6.3 src/sys/net/if_media.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/if_media.c
diff -u src/sys/net/if_media.c:1.32.6.2 src/sys/net/if_media.c:1.32.6.3
--- src/sys/net/if_media.c:1.32.6.2	Tue Jan  2 10:20:33 2018
+++ src/sys/net/if_media.c	Tue May 14 11:37:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.c,v 1.32.6.2 2018/01/02 10:20:33 snj Exp $	*/
+/*	$NetBSD: if_media.c,v 1.32.6.3 2019/05/14 11:37:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.32.6.2 2018/01/02 10:20:33 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.32.6.3 2019/05/14 11:37:12 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -335,6 +335,9 @@ _ifmedia_ioctl(struct ifnet *ifp, struct
 			    : nwords;
 			int *kptr = (int *)malloc(minwords * sizeof(int),
 			    M_TEMP, M_WAITOK);
+
+			if (kptr == NULL)
+				return ENOMEM;
 			/*
 			 * Get the media words from the interface's list.
 			 */

Reply via email to