diff options
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_recv.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_recv.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 35c721a50598..2ef31a4e9a6b 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -258,7 +258,7 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter, /* get ether_type */ ptr = ptr + pfhdr->attrib.hdrlen + LLC_HEADER_SIZE; memcpy(ðer_type, ptr, 2); - ether_type = ntohs((unsigned short)ether_type); + be16_to_cpus(ðer_type); if ((psta != NULL) && (psta->ieee8021x_blocked)) { /* blocked @@ -640,17 +640,23 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) /* append rx status for mp test packets */ ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2) - 24); + if (!ptr) + return _FAIL; memcpy(ptr, get_rxmem(precvframe), 24); ptr += 24; - } else + } else { ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0))); + if (!ptr) + return _FAIL; + } memcpy(ptr, pattrib->dst, ETH_ALEN); memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN); if (!bsnaphdr) { - len = htons(len); - memcpy(ptr + 12, &len, 2); + __be16 be_tmp = htons(len); + + memcpy(ptr + 12, &be_tmp, 2); } return _SUCCESS; } |