summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-06-21 21:22:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-06-21 21:22:28 +0000
commit19097b03ee0e71f51bbc44f98770945e0303fb30 (patch)
tree28770aa017fa4402653dd26f684df4f6dba59d7c
parent9b7bdd8d3c45a78fac0d3a26a981504b551cd15c (diff)
Don't use uninitialized data as a return value.
From Brainy via Maxime Villard via tech@. ok kettenis@
-rw-r--r--sys/dev/ic/an.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c
index e3e1d6452d7..077cf7afab4 100644
--- a/sys/dev/ic/an.c
+++ b/sys/dev/ic/an.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: an.c,v 1.64 2015/02/10 23:25:46 mpi Exp $ */
+/* $OpenBSD: an.c,v 1.65 2015/06/21 21:22:27 krw Exp $ */
/* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1027,8 +1027,8 @@ an_init(struct ifnet *ifp)
memcpy(sc->sc_buf.sc_ssidlist.an_entry[0].an_ssid,
ic->ic_des_essid, ic->ic_des_esslen);
an_swap16((u_int16_t *)&sc->sc_buf.sc_ssidlist.an_entry[0].an_ssid, 16);
- if (an_write_rid(sc, AN_RID_SSIDLIST, &sc->sc_buf,
- sizeof(sc->sc_buf.sc_ssidlist)) != 0) {
+ if ((error = an_write_rid(sc, AN_RID_SSIDLIST, &sc->sc_buf,
+ sizeof(sc->sc_buf.sc_ssidlist)))) {
printf("%s: failed to write ssid list\n", ifp->if_xname);
an_stop(ifp, 1);
return error;
@@ -1054,8 +1054,8 @@ an_init(struct ifnet *ifp)
sc->sc_tx_key);
/* Set the configuration */
- if (an_write_rid(sc, AN_RID_GENCONFIG, &sc->sc_config,
- sizeof(sc->sc_config)) != 0) {
+ if ((error = an_write_rid(sc, AN_RID_GENCONFIG, &sc->sc_config,
+ sizeof(sc->sc_config)))) {
printf("%s: failed to write config\n", ifp->if_xname);
an_stop(ifp, 1);
return error;