kernel: Fix sizeof()s that were taking a pointer.
authorSascha Wildner <saw@online.de>
Sun, 20 Nov 2011 15:39:50 +0000 (16:39 +0100)
committerSascha Wildner <saw@online.de>
Sun, 20 Nov 2011 15:41:07 +0000 (16:41 +0100)
sys/netinet/sctp_usrreq.c
sys/netproto/802_11/wlan/ieee80211_ageq.c
sys/netproto/802_11/wlan/ieee80211_power.c

index 7e0a3b3..ea93f8e 100644 (file)
@@ -1909,7 +1909,7 @@ sctp_optsget(struct socket *so,
                        break;
                }
                events = mtod(m, struct sctp_event_subscribe *);
-               memset(events, 0, sizeof(events));
+               memset(events, 0, sizeof(*events));
                SCTP_INP_RLOCK(inp);
                if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVDATAIOEVNT)
                        events->sctp_data_io_event = 1;
index c0dd34d..ea9095a 100644 (file)
@@ -23,7 +23,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: head/sys/net80211/ieee80211_ageq.c 195527 2009-07-10 02:19:57Z sam $
- * $DragonFly$
  */
 
 /*
@@ -50,7 +49,7 @@
 void
 ieee80211_ageq_init(struct ieee80211_ageq *aq, int maxlen, const char *name)
 {
-       memset(aq, 0, sizeof(aq));
+       memset(aq, 0, sizeof(*aq));
        aq->aq_maxlen = maxlen;
 }
 
index d465ae3..24c70e1 100644 (file)
@@ -23,7 +23,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: head/sys/net80211/ieee80211_power.c 186302 2008-12-18 23:00:09Z sam $
- * $DragonFly$
  */
 
 /*
@@ -103,7 +102,7 @@ ieee80211_power_vdetach(struct ieee80211vap *vap)
 void
 ieee80211_psq_init(struct ieee80211_psq *psq, const char *name)
 {
-       memset(psq, 0, sizeof(psq));
+       memset(psq, 0, sizeof(*psq));
        psq->psq_maxlen = IEEE80211_PS_MAX_QUEUE;
 }