Module Name: src
Committed By: pgoyette
Date: Mon May 4 23:50:36 UTC 2015
Modified Files:
src/sys/dev/sysmon: sysmon.c
Log Message:
If autoload of the subcomponent module fails, don't try to call its
open routine. Just return an error.
Hopefully this will fix the recently reported issues with atf tests
running on xen guest.
-=-=-=-=-=-
#include <sys/param.h>
#include <sys/conf.h>
@@ -153,8 +153,10 @@ sysmonopen(dev_t dev, int flag, int mode
error = module_autoload(sysmon_mod[minor(dev)],
MODULE_CLASS_MISC);
I am confused; at this point if autoload returned an error, why bother
continuing and losing the error return from the autoload? Why not add:
if (error)
break;
mutex_enter(&sysmon_minor_mtx);
- if (sysmon_opvec_table[minor(dev)] == NULL)
+ if (sysmon_opvec_table[minor(dev)] == NULL) {
error = ENODEV;
+ break;
+ }
}
error = (sysmon_opvec_table[minor(dev)]->so_open)(dev, flag,
mode, l);
-=-=-=-=-=-