Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2159868ybz; Thu, 23 Apr 2020 12:40:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJg9ukgdQQIKRHui6r8SXANHGlR5L5Zth47JKjLVIBc3X6FSOyNd17UGOLYzmbdZwVXKxoA X-Received: by 2002:aa7:ca48:: with SMTP id j8mr3996157edt.328.1587670812211; Thu, 23 Apr 2020 12:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587670812; cv=none; d=google.com; s=arc-20160816; b=vSVL0dpoMmayoBBBPj8p9kG6skq4zbaeNfK0Y8p8zQEg8RxpP38jLRfR3TGO+oKmY6 zlfFHn5YTEjyQQr4CMGK3h08c2S2n/bfFGRRowJMsnuFBDiHEzf6PeS7tJziA1SEoAXD PH/uCTwLZQsvbh4irBYtfFhX/jnXSxpNKkAdJRBJtvDB6isszNehe7v7bKRVKC0828PF aNVjDCfbkYG4FYYfNpFu96KPEIG+GbEWddVRPxHtLYwyuN0RXIeP9fUeD2jVepNIvNfp j9T4ZzlPVg08AlSX75yuDFtBgEnFfON/945UL1KivjSkZ21J/6vjcrrOodTAr1ZRdoOV HqcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=w0h2+HD12jslhQhVTfHXo4XzcR3CkQ35KAkzWejng0I=; b=b8DuHWXKzBs3mVS195+EoYl3uLye9aD+Gk4wNCwQ9RHEsWAw5SaHT5ppo1Zjgy6RAu Injue3seIvd7FLTIgl/uPr59x2m1ymc7qUcc2R2+oN2NhOhF+lG/3bNWF46nnf3VbB6p iF7Ebw+mIwRZHLKlvtmdIVciEqhBMPqLIvABfk5WSrY+Y1feOiAkxcWwjxKX6HNOn/xS DbXkU0F7J60+keDviWLMnrn34WsJf7Re8czkFonToI/EmIwQMzSbLYKo4ALL7kXLBwnj RcTz/sSkA3YUJ30C/R6BZHOKXqwI/NN5fI43b5DzCC2eBhU2PeUMCxFjEX0VpsOOr/Lz FaWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uXmeyzjx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si1927321eja.190.2020.04.23.12.39.49; Thu, 23 Apr 2020 12:40:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uXmeyzjx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727117AbgDWTJy (ORCPT + 99 others); Thu, 23 Apr 2020 15:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbgDWTJy (ORCPT ); Thu, 23 Apr 2020 15:09:54 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFCE3C09B043 for ; Thu, 23 Apr 2020 12:09:53 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id a21so4526901ljj.11 for ; Thu, 23 Apr 2020 12:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w0h2+HD12jslhQhVTfHXo4XzcR3CkQ35KAkzWejng0I=; b=uXmeyzjxovJLmE/4VWvDRDrzLChw9L+6DpVyKT5C+V5TxPbUhch0J89GUxxHyq8oGj iyRKDD+wUQ+o72YCH4qEvKrOG7fhU0vN24auW/STeS5rmBCCHcOP6EAQ4JDnsL3a2GwY zMpfRM/APtycZNYr7Cb20jpVIyA10ohAE+tTAcVEU7ZtBExsl1kHGI0ZrqlrSj1+9oeQ 4J5uzfmLNJWHBKTWFl9dWZ74RS/ljfMQ5Gu84gRHTFYVC8jrqFd+KnGmxuT22sKl4i6Y JisXvchWTWzCMUgL4RhtsABbhrCKyV93baq1wS3DwIMfywuma003Kik17UemvTp/ajKa 1LDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w0h2+HD12jslhQhVTfHXo4XzcR3CkQ35KAkzWejng0I=; b=DAWNQHa4tD/04m1SCDc8HWj7w6e+79hIL+rl3VoImtXAODGHogMtUIHMl7fUSCHFw2 MV+tBC5+l1hK5nhGCns0Gpb5mG7qIF4eSJT8gFqepst6LVr1t+nYolKuqcwFVV9VbyJU cF9ekgB4qDZw5y2sqTZLmJ93SiP903Nk0/aCWYyco7GQZpr0ZxxI4UWEiJZSRD1uEImi VX/u1eUInovb1E/5jktJ6mdMFU4zIPa9yb/f5e7AXfu3IAflFpKla4E3bM64FF5uKwJw QKxeV9dRNqFx4BQ4wnicHpaCI9zAT37imJgnwr3CriSmmtbR7FMWeQplfJMt6K3bgu8F N7ug== X-Gm-Message-State: AGi0PubH/3wnaiac3K3HECUSkE5WaD+ZQO+aa+l7tVhB+pJ4I+UeTGF2 I3cKcWN1nZGV9q7EafM5WAY= X-Received: by 2002:a2e:990f:: with SMTP id v15mr2083262lji.7.1587668992125; Thu, 23 Apr 2020 12:09:52 -0700 (PDT) Received: from alpha (84.188.smarthome.spb.ru. [80.249.188.84]) by smtp.gmail.com with ESMTPSA id z9sm3145981lfd.9.2020.04.23.12.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 12:09:51 -0700 (PDT) Received: (nullmailer pid 12103 invoked by uid 1000); Thu, 23 Apr 2020 19:14:18 -0000 From: Ivan Safonov To: Larry Finger Cc: Greg Kroah-Hartman , Puranjay Mohan , Saurav Girepunje , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Ivan Safonov Subject: [PATCH v2] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion Date: Thu, 23 Apr 2020 22:14:04 +0300 Message-Id: <20200423191404.12028-1-insafonov@gmail.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org skb clones use same data buffer, so tail of one skb is corrupted by beginning of next skb. Signed-off-by: Ivan Safonov --- Changes in v2: - long line in the commit message is divided into two parts. drivers/staging/rtl8188eu/core/rtw_recv.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index d4278361e002..a036ef104198 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1525,21 +1525,14 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) /* Allocate new skb for releasing to upper layer */ sub_skb = dev_alloc_skb(nSubframe_Length + 12); - if (sub_skb) { - skb_reserve(sub_skb, 12); - skb_put_data(sub_skb, pdata, nSubframe_Length); - } else { - sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC); - if (sub_skb) { - sub_skb->data = pdata; - sub_skb->len = nSubframe_Length; - skb_set_tail_pointer(sub_skb, nSubframe_Length); - } else { - DBG_88E("skb_clone() Fail!!! , nr_subframes=%d\n", nr_subframes); - break; - } + if (!sub_skb) { + DBG_88E("dev_alloc_skb() Fail!!! , nr_subframes=%d\n", nr_subframes); + break; } + skb_reserve(sub_skb, 12); + skb_put_data(sub_skb, pdata, nSubframe_Length); + subframes[nr_subframes++] = sub_skb; if (nr_subframes >= MAX_SUBFRAME_COUNT) { -- 2.25.3