Don't save SYSCTL_ADD_*() results in a local variable just to throw them

away; preserve the ones that are needed for further calls in the init
function and ignore the rest entirely.

Found with:	Coverity Prevent(tm)
CID:		563
This commit is contained in:
rwatson 2007-05-28 18:20:15 +00:00
parent 3049018c51
commit 3588274784

View File

@ -119,54 +119,48 @@ random_yarrow_init(void)
{
int error, i;
struct harvest *np;
struct sysctl_oid *o, *random_o, *random_sys_o, *random_sys_harvest_o;
struct sysctl_oid *random_o, *random_sys_o, *random_sys_harvest_o;
enum esource e;
o = SYSCTL_ADD_NODE(&random_clist,
random_o = SYSCTL_ADD_NODE(&random_clist,
SYSCTL_STATIC_CHILDREN(_kern),
OID_AUTO, "random", CTLFLAG_RW, 0,
"Software Random Number Generator");
random_o = o;
random_yarrow_init_alg(&random_clist, random_o);
o = SYSCTL_ADD_NODE(&random_clist,
random_sys_o = SYSCTL_ADD_NODE(&random_clist,
SYSCTL_CHILDREN(random_o),
OID_AUTO, "sys", CTLFLAG_RW, 0,
"Entropy Device Parameters");
random_sys_o = o;
o = SYSCTL_ADD_PROC(&random_clist,
SYSCTL_ADD_PROC(&random_clist,
SYSCTL_CHILDREN(random_sys_o),
OID_AUTO, "seeded", CTLTYPE_INT | CTLFLAG_RW,
&random_systat.seeded, 1, random_check_boolean, "I",
"Seeded State");
o = SYSCTL_ADD_NODE(&random_clist,
random_sys_harvest_o = SYSCTL_ADD_NODE(&random_clist,
SYSCTL_CHILDREN(random_sys_o),
OID_AUTO, "harvest", CTLFLAG_RW, 0,
"Entropy Sources");
random_sys_harvest_o = o;
o = SYSCTL_ADD_PROC(&random_clist,
SYSCTL_ADD_PROC(&random_clist,
SYSCTL_CHILDREN(random_sys_harvest_o),
OID_AUTO, "ethernet", CTLTYPE_INT | CTLFLAG_RW,
&harvest.ethernet, 1, random_check_boolean, "I",
"Harvest NIC entropy");
o = SYSCTL_ADD_PROC(&random_clist,
SYSCTL_ADD_PROC(&random_clist,
SYSCTL_CHILDREN(random_sys_harvest_o),
OID_AUTO, "point_to_point", CTLTYPE_INT | CTLFLAG_RW,
&harvest.point_to_point, 1, random_check_boolean, "I",
"Harvest serial net entropy");
o = SYSCTL_ADD_PROC(&random_clist,
SYSCTL_ADD_PROC(&random_clist,
SYSCTL_CHILDREN(random_sys_harvest_o),
OID_AUTO, "interrupt", CTLTYPE_INT | CTLFLAG_RW,
&harvest.interrupt, 1, random_check_boolean, "I",
"Harvest IRQ entropy");
o = SYSCTL_ADD_PROC(&random_clist,
SYSCTL_ADD_PROC(&random_clist,
SYSCTL_CHILDREN(random_sys_harvest_o),
OID_AUTO, "swi", CTLTYPE_INT | CTLFLAG_RW,
&harvest.swi, 0, random_check_boolean, "I",