Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sysmon 1. Don't try to call the driver's get_limits ...
details: https://anonhg.NetBSD.org/src/rev/962b4f83004c
branches: trunk
changeset: 757771:962b4f83004c
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Sep 22 00:13:55 2010 +0000
description:
1. Don't try to call the driver's get_limits routine if it doesn't have
one. Fixes a panic reported by njoly@ in private Email
2. Acquire the device before checking whether or not the get_limits
routine exists.
XXX There's still a bug in here somewhere that prevents setting of
XXX limit values after using 'envstat -S'
diffstat:
sys/dev/sysmon/sysmon_envsys_events.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diffs (47 lines):
diff -r 4671ad78042a -r 962b4f83004c sys/dev/sysmon/sysmon_envsys_events.c
--- a/sys/dev/sysmon/sysmon_envsys_events.c Tue Sep 21 19:26:18 2010 +0000
+++ b/sys/dev/sysmon/sysmon_envsys_events.c Wed Sep 22 00:13:55 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.92 2010/04/10 19:01:01 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.93 2010/09/22 00:13:55 pgoyette Exp $ */
/*-
* Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.92 2010/04/10 19:01:01 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.93 2010/09/22 00:13:55 pgoyette Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -546,12 +546,12 @@
{
int err;
+ sysmon_envsys_acquire(sme, false);
if (sme->sme_get_limits == NULL ||
(edata->flags & ENVSYS_FMONLIMITS) == 0)
- return EINVAL;
-
- sysmon_envsys_acquire(sme, false);
- err = sme_update_limits(sme, edata);
+ err = EINVAL;
+ else
+ err = sme_update_limits(sme, edata);
sysmon_envsys_release(sme, false);
return err;
@@ -595,8 +595,9 @@
if (see == NULL)
return EINVAL;
- /* Get new limit values */
- (*sme->sme_get_limits)(sme, edata, &lims, &props);
+ /* Update limit values from driver if possible */
+ if (sme->sme_get_limits != NULL)
+ (*sme->sme_get_limits)(sme, edata, &lims, &props);
/* Update event and dictionary */
sme_event_register(sdict, edata, sme, &lims, props,
Home |
Main Index |
Thread Index |
Old Index