mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Safonov <insafonov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>,
	Ivan Safonov <insafonov@gmail.com>,
	Luca Ceresoli <luca@lucaceresoli.net>,
	Geliang Tang <geliangtang@163.com>,
	Binoy Jayan <binoy.jayan@linaro.org>,
	Victor Carvajal <carva005@gmail.com>,
	Pierre-Yves Kerbrat <pkerbrat@free.fr>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] staging:r8188eu: eleminate recovery attemp using skb_clone after netdev_alloc_skb fail
Date: Wed,  4 Jan 2017 17:22:17 +0700	[thread overview]
Message-ID: <20170104102218.12041-4-insafonov@gmail.com> (raw)
In-Reply-To: <20170104102218.12041-1-insafonov@gmail.com>

It is wrong to create new skb using skb_clone instead netdev_alloc_skb,
because buffer data will be changed later.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index e2dbe1b..5f6cbe0 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -133,22 +133,9 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
 			precvframe->rx_tail = pkt_copy->data;
 			precvframe->rx_data = pkt_copy->data;
 		} else {
-			if ((pattrib->mfrag == 1) && (pattrib->frag_num == 0)) {
-				DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
-				rtw_free_recvframe(precvframe, pfree_recv_queue);
-				goto _exit_recvbuf2recvframe;
-			}
-			precvframe->pkt = skb_clone(pskb, GFP_ATOMIC);
-			if (precvframe->pkt) {
-				precvframe->rx_tail = pbuf + pattrib->drvinfo_sz + RXDESC_SIZE;
-				precvframe->rx_head = precvframe->rx_tail;
-				precvframe->rx_data = precvframe->rx_tail;
-				precvframe->rx_end =  pbuf + pattrib->drvinfo_sz + RXDESC_SIZE + alloc_sz;
-			} else {
-				DBG_88E("recvbuf2recvframe: skb_clone fail\n");
-				rtw_free_recvframe(precvframe, pfree_recv_queue);
-				goto _exit_recvbuf2recvframe;
-			}
+			DBG_88E("recvbuf2recvframe: alloc_skb fail , drop frag frame\n");
+			rtw_free_recvframe(precvframe, pfree_recv_queue);
+			goto _exit_recvbuf2recvframe;
 		}
 
 		recvframe_put(precvframe, skb_len);
-- 
2.10.2

  parent reply	other threads:[~2017-01-04 10:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 10:22 [PATCH 1/5] staging:r8188eu: remove RTW_STATUS_CODE() Ivan Safonov
2017-01-04 10:22 ` [PATCH 2/5] staging:r8188eu: remove rtw_update_mem_stat definition Ivan Safonov
2017-01-04 10:22 ` [PATCH 3/5] staging:r8188eu: remove (NDEV|ADPT)_(FMT|ARG) definitions Ivan Safonov
2017-01-04 10:22 ` Ivan Safonov [this message]
2017-01-04 10:22 ` [PATCH 5/5] staging:r8188eu: remove unused WIFI_MP_*STATE and WIFI_MP_CTX* definitions Ivan Safonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170104102218.12041-4-insafonov@gmail.com \
    --to=insafonov@gmail.com \
    --cc=bhaktipriya96@gmail.com \
    --cc=binoy.jayan@linaro.org \
    --cc=carva005@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=geliangtang@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca@lucaceresoli.net \
    --cc=pkerbrat@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®