Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern protect against NULL, from PaulG
details: https://anonhg.NetBSD.org/src/rev/84add9ef5ede
branches: trunk
changeset: 353560:84add9ef5ede
user: christos <christos%NetBSD.org@localhost>
date: Thu May 11 23:50:17 2017 +0000
description:
protect against NULL, from PaulG
diffstat:
sys/kern/kern_event.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r 367fd241b8e4 -r 84add9ef5ede sys/kern/kern_event.c
--- a/sys/kern/kern_event.c Thu May 11 23:39:15 2017 +0000
+++ b/sys/kern/kern_event.c Thu May 11 23:50:17 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_event.c,v 1.90 2017/05/09 21:18:51 christos Exp $ */
+/* $NetBSD: kern_event.c,v 1.91 2017/05/11 23:50:17 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.90 2017/05/09 21:18:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.91 2017/05/11 23:50:17 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1020,9 +1020,10 @@
KERNEL_UNLOCK_ONE(NULL); /* XXXSMP */
if (error != 0) {
#ifdef DIAGNOSTIC
+
printf("%s: event not supported for file type"
- " %d (error %d)\n", __func__,
- ((file_t *)kn->kn_obj)->f_type, error);
+ " %d (error %d)\n", __func__, kn->kn_obj ?
+ ((file_t *)kn->kn_obj)->f_type : -1, error);
#endif
/* knote_detach() drops fdp->fd_lock */
knote_detach(kn, fdp, false);
Home |
Main Index |
Thread Index |
Old Index