mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
staging: rtl8723bs: use standard skb allocation APIs
Replace custom wrappers rtw_skb_alloc() and rtw_skb_copy() with standard kernel APIs __dev_alloc_skb() and skb_copy(). About GFP Flags: - GFP_ATOMIC is used for allocations in atomic contexts such as spinlock-protected sections, tasklets, and timer handlers. - GFP_KERNEL is used for process contexts where sleeping is allowed. Signed-off-by: Minu Jin <s9430939@naver.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://patch.msgid.link/20260204131347.3515949-5-s9430939@naver.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
980cd426a2
commit
9fe6f146a3
|
|
@ -1630,7 +1630,7 @@ static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubfra
|
|||
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
|
||||
sub_skb = __dev_alloc_skb(nSubframe_Length + 12, GFP_ATOMIC);
|
||||
if (!sub_skb)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
|
|||
alloc_sz += 14;
|
||||
}
|
||||
|
||||
pkt_copy = rtw_skb_alloc(alloc_sz);
|
||||
pkt_copy = __dev_alloc_skb(alloc_sz, GFP_ATOMIC);
|
||||
if (!pkt_copy) {
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
|
|
@ -397,8 +397,7 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
|
|||
SIZE_PTR tmpaddr = 0;
|
||||
SIZE_PTR alignment = 0;
|
||||
|
||||
precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||
|
||||
precvbuf->pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_ATOMIC);
|
||||
if (precvbuf->pskb) {
|
||||
precvbuf->pskb->dev = padapter->pnetdev;
|
||||
|
||||
|
|
|
|||
|
|
@ -810,7 +810,7 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size)
|
|||
SIZE_PTR tmpaddr = 0;
|
||||
SIZE_PTR alignment = 0;
|
||||
|
||||
recvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||
recvbuf->pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_ATOMIC);
|
||||
if (!recvbuf->pskb)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -162,8 +162,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
|
|||
!memcmp(psta->hwaddr, bc_addr, 6))
|
||||
continue;
|
||||
|
||||
newskb = rtw_skb_copy(skb);
|
||||
|
||||
newskb = skb_copy(skb, GFP_ATOMIC);
|
||||
if (newskb) {
|
||||
memcpy(newskb->data, psta->hwaddr, 6);
|
||||
res = rtw_xmit(padapter, &newskb);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user