mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
staging: rtl: fix possible NULL pointer dereference
am: 272d60bfce
Change-Id: I49cd1afa12c293484de6c18eb31e67d2baa0a4d4
This commit is contained in:
@@ -1405,6 +1405,9 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
|
||||
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);
|
||||
|
||||
|
||||
@@ -641,11 +641,16 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user