Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/sysmon



In article <20150504235036.D53419A%cvs.netbsd.org@localhost>,
Paul Goyette <source-changes-d%NetBSD.org@localhost> wrote:
>-=-=-=-=-=-
>
>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.
>
>
>To generate a diff of this commit:
>cvs rdiff -u -r1.25 -r1.26 src/sys/dev/sysmon/sysmon.c
>
>Please note that diffs are not public domain; they are subject to the
>copyright notices on the relevant files.
>
>
>-=-=-=-=-=-
>
> #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;

christos

> 			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);
>
>
>-=-=-=-=-=-





Home | Main Index | Thread Index | Old Index