Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944432AbcJSPNh (ORCPT ); Wed, 19 Oct 2016 11:13:37 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33446 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943803AbcJSPGZ (ORCPT ); Wed, 19 Oct 2016 11:06:25 -0400 From: Ivan Safonov To: Greg Kroah-Hartman , Bhaktipriya Shridhar , Andy Shevchenko , Geliang Tang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: insafonov@gmail.com Subject: [PATCH 03/37] staging:r8188eu: remove skb cloning after netdev_alloc_skb fail Date: Wed, 19 Oct 2016 22:07:31 +0700 Message-Id: <1476889685-7367-3-git-send-email-insafonov@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1476889685-7367-1-git-send-email-insafonov@gmail.com> References: <1476889685-7367-1-git-send-email-insafonov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1591 Lines: 39 In accordance with the KISS principle. Signed-off-by: Ivan Safonov --- 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 f19b203..4b078b5 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c @@ -132,22 +132,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.7.3