Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Add missing error check.
details: https://anonhg.NetBSD.org/src/rev/3625c5f0dc5c
branches: trunk
changeset: 450691:3625c5f0dc5c
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Mon Apr 22 11:10:52 2019 +0000
description:
Add missing error check.
diffstat:
sys/net/if_media.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r ea5db31a2b5f -r 3625c5f0dc5c sys/net/if_media.c
--- a/sys/net/if_media.c Mon Apr 22 10:44:55 2019 +0000
+++ b/sys/net/if_media.c Mon Apr 22 11:10:52 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_media.c,v 1.41 2019/04/16 06:48:33 msaitoh Exp $ */
+/* $NetBSD: if_media.c,v 1.42 2019/04/22 11:10:52 msaitoh 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.41 2019/04/16 06:48:33 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.42 2019/04/22 11:10:52 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -342,6 +342,8 @@
int *kptr = malloc(minwords * sizeof(int), M_TEMP,
M_WAITOK);
+ if (kptr == NULL)
+ return ENOMEM;
/* Get the media words from the interface's list. */
ep = TAILQ_FIRST(&ifm->ifm_list);
for (count = 0; ep != NULL && count < minwords;
Home |
Main Index |
Thread Index |
Old Index