From 5597647226d5863743e4f7810f27d6960d542701 Mon Sep 17 00:00:00 2001 From: Jay Jayanna Date: Wed, 8 Jan 2020 18:04:44 -0800 Subject: [PATCH] net: qrtr: Use alloc_skb_with_frags for backup memory Use alloc_skb_with_frags for skb allocation to keep it uniform throughout the rx path. Change-Id: Id38eeea0a7d422b50c1ad6a90b9b569f26c45917 Signed-off-by: Jay Jayanna --- net/qrtr/qrtr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 70c607b6cd79..0bd8625bf69c 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -696,15 +696,20 @@ EXPORT_SYMBOL(qrtr_peek_pkt_size); static void qrtr_alloc_backup(struct work_struct *work) { struct sk_buff *skb; + int errcode; while (skb_queue_len(&qrtr_backup_lo) < QRTR_BACKUP_LO_NUM) { - skb = alloc_skb(QRTR_BACKUP_LO_SIZE, GFP_KERNEL); + skb = alloc_skb_with_frags(sizeof(struct qrtr_hdr_v1), + QRTR_BACKUP_LO_SIZE, 0, &errcode, + GFP_KERNEL); if (!skb) break; skb_queue_tail(&qrtr_backup_lo, skb); } while (skb_queue_len(&qrtr_backup_hi) < QRTR_BACKUP_HI_NUM) { - skb = alloc_skb(QRTR_BACKUP_HI_SIZE, GFP_KERNEL); + skb = alloc_skb_with_frags(sizeof(struct qrtr_hdr_v1), + QRTR_BACKUP_HI_SIZE, 0, &errcode, + GFP_KERNEL); if (!skb) break; skb_queue_tail(&qrtr_backup_hi, skb);