From a807afdc62a3acdd7f0a0fc7d86f33aea9a56136 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 13 Dec 2004 07:37:55 +0000 Subject: set the buffer up before we try to use it. fixes a panic on sparc64 which didn't manifest on i386 for some reason. --- sys/dev/usb/if_atu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/usb') diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c index a2178b5fb14..ac67b8cf260 100644 --- a/sys/dev/usb/if_atu.c +++ b/sys/dev/usb/if_atu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atu.c,v 1.43 2004/12/12 08:45:36 dlg Exp $ */ +/* $OpenBSD: if_atu.c,v 1.44 2004/12/13 07:37:54 dlg Exp $ */ /* * Copyright (c) 2003, 2004 * Daan Vreeken . All rights reserved. @@ -1639,14 +1639,14 @@ atu_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) h = (struct atu_rx_hdr *)c->atu_buf; len = h->length - 4; /* XXX magic number */ - wh = mtod(m, struct ieee80211_frame *); - ni = ieee80211_find_rxnode(ic, wh); - m = c->atu_mbuf; memcpy(mtod(m, char *), c->atu_buf + ATU_RX_HDRLEN, len); m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; + wh = mtod(m, struct ieee80211_frame *); + ni = ieee80211_find_rxnode(ic, wh); + ifp->if_ipackets++; s = splnet(); -- cgit v1.2.3