Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Minu Jin and committed by
Greg Kroah-Hartman
9fe6f146 980cd426

+5 -7
+1 -1
drivers/staging/rtl8723bs/core/rtw_recv.c
··· 1630 1630 1631 1631 pattrib = &prframe->u.hdr.attrib; 1632 1632 1633 - sub_skb = rtw_skb_alloc(nSubframe_Length + 12); 1633 + sub_skb = __dev_alloc_skb(nSubframe_Length + 12, GFP_ATOMIC); 1634 1634 if (!sub_skb) 1635 1635 return NULL; 1636 1636
+2 -3
drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
··· 290 290 alloc_sz += 14; 291 291 } 292 292 293 - pkt_copy = rtw_skb_alloc(alloc_sz); 293 + pkt_copy = __dev_alloc_skb(alloc_sz, GFP_ATOMIC); 294 294 if (!pkt_copy) { 295 295 rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue); 296 296 break; ··· 397 397 SIZE_PTR tmpaddr = 0; 398 398 SIZE_PTR alignment = 0; 399 399 400 - precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); 401 - 400 + precvbuf->pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_ATOMIC); 402 401 if (precvbuf->pskb) { 403 402 precvbuf->pskb->dev = padapter->pnetdev; 404 403
+1 -1
drivers/staging/rtl8723bs/hal/sdio_ops.c
··· 810 810 SIZE_PTR tmpaddr = 0; 811 811 SIZE_PTR alignment = 0; 812 812 813 - recvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); 813 + recvbuf->pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_ATOMIC); 814 814 if (!recvbuf->pskb) 815 815 return NULL; 816 816
+1 -2
drivers/staging/rtl8723bs/os_dep/xmit_linux.c
··· 162 162 !memcmp(psta->hwaddr, bc_addr, 6)) 163 163 continue; 164 164 165 - newskb = rtw_skb_copy(skb); 166 - 165 + newskb = skb_copy(skb, GFP_ATOMIC); 167 166 if (newskb) { 168 167 memcpy(newskb->data, psta->hwaddr, 6); 169 168 res = rtw_xmit(padapter, &newskb);