mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
staging: rtl: fix possible NULL pointer dereference
am: c7472b964d
Change-Id: I47f0d514222016b00d200d2c4642e18c23f494fb
This commit is contained in:
@@ -1383,6 +1383,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);
|
||||
|
||||
|
||||
@@ -643,11 +643,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