Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1476309ybz; Sat, 18 Apr 2020 01:40:07 -0700 (PDT) X-Google-Smtp-Source: APiQypLaVzV6jetSNl+l5XzT+4DZlK5e7dO+WTE0M/fiaEgJtEzqN+p/5mnvd273vbXY11I2Y+0d X-Received: by 2002:a17:906:4a4e:: with SMTP id a14mr5710776ejv.363.1587199206995; Sat, 18 Apr 2020 01:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587199206; cv=none; d=google.com; s=arc-20160816; b=RV/y/TmRuOUDYv8FVTjfAsS26huFptZcs0pXYcq59eS9xm8ujkRxOvrPFrkyrbHSp3 tOkjRnMDAKaNpMQpIPDfu6ZA8wafw/O8Fvrj3T94FqmuCnRCJmhV3q+gpxYIZzEMfI1m c9H53m9ycCjxL0edzT5vSYEN0eUBsLYr2i9L0zdFKO9YqM6k6rDaOwoBv9C55+Byk0CO NWgeEHLCGLW8zJov9lQnfbvDb4u7fqvuzC04hX2TM5lzcvazSmfyMBdbxGWglSvZQCdR azP+e5eluLCHhX4BwIMxziwbvxj2s5HbX4rlxWqnz7Sdk8Zww/ELH7djyOC+tWe/tnmu aabQ== 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=7/6//M0ZzMZYaNauz99M15j4KPCmpQuIwWItAHuzh60=; b=g3XFjHNqme1J+ZbzLjX85/5VgoZiJ+XwKVeNXM9XqXrrB22jTqQ2sTm+sibdJKqBgD h7xUPaRp4ebKEDjnrjjfX2LTt5cJYuqDkwgwlq4dGXqMOfB0uOxwgrcqLR+zW1Ob/7Re 0OTKFUKnJIgCl6QP7JvVcl5XzABkB3twATfm8/jq3dHingoyQ5PYfK6q/ena1fusP2fs qivKf61xViAkyLpZlkv+5R8RE8ZRc4uzmeMP/PKAhy+D/mEesntQ0q4b1esfnpwZd751 PXPF22YqiaumFEHxNZM2qC7mjBEeolzzeft6nwFFX62vwPCCs8dEkX35pZAw+ctZsWx6 xaJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NxfPyiq4; 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 m15si12637091edv.563.2020.04.18.01.39.44; Sat, 18 Apr 2020 01:40:06 -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=NxfPyiq4; 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 S1725970AbgDRIgi (ORCPT + 99 others); Sat, 18 Apr 2020 04:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbgDRIgi (ORCPT ); Sat, 18 Apr 2020 04:36:38 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B0CBC061A0C for ; Sat, 18 Apr 2020 01:36:37 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id q19so4436022ljp.9 for ; Sat, 18 Apr 2020 01:36:37 -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=7/6//M0ZzMZYaNauz99M15j4KPCmpQuIwWItAHuzh60=; b=NxfPyiq4iJXOVjnaTadZFBInGPBNrnbwZ79ocfZASYenBByQJX7OwzgXw/uWkRFsuF YVlkYkSzm0Aq1f/HP+qpg0pWKrV7fpCWwjrruh0jDKc1wom8NtWA139shgTnJIdPrr02 Z4c77VP9R6gGMx/rVVzVTw1Y7XJTHk69h39PG2HsiuDiQj6Mvt5UYdDsRUwCB1y8ruQC F4ltdwb0/b9dIzlIoR/RpK5mjt60xe8Ss/KIOOb9nZjmyZifgVpzVNmVLU6tSj+7LPF0 hNlooU8F7cYFvLCpmSBlOyFbriJABQsUB6dGdSGw+UFc+y7DKIbcYckY+gXwEXbQc/em 2KrQ== 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=7/6//M0ZzMZYaNauz99M15j4KPCmpQuIwWItAHuzh60=; b=SrNB2ESpIbrbcwhtUXzqocErNqSR4Kq+lTWsH/u4hlvABrM5xhcNNvnnDrMSrnaOZr Jq9aMicP76rS8Q5vX51HHalwn5gsGxzoiwxwM+YicXTmwPXbgtpORtW9UfRL459s2CTo 2N0G0KQuWNKeq+JeELhuE/lnxni6RbN4ZCEaMuYjf/ewq9GvLFJSgTfWliDXg8rxj8RS gL8r6+Rj3zfsGqluBwkc5EZ+0IEhbVPIZdg/NKh9+1fWWMOVzGKlGFXPxdV51YiGY4xh EAG1hNG8jIotbgqIK58ooGygKATmaWt+pb3naUJg7GeXHpp6/mF8Iox4YS6GvCHDt7RC cPUg== X-Gm-Message-State: AGi0PuboSVVVAxV64QtJocCsDZvGBDehOtzCOIaTDdCVj6sK86naOaif 23PwDluQjM6DuOXgWOnGtQcA+FNy X-Received: by 2002:a2e:330e:: with SMTP id d14mr4338860ljc.153.1587198996062; Sat, 18 Apr 2020 01:36:36 -0700 (PDT) Received: from alpha (84.188.smarthome.spb.ru. [80.249.188.84]) by smtp.gmail.com with ESMTPSA id j14sm19484204lfm.73.2020.04.18.01.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2020 01:36:35 -0700 (PDT) Received: (nullmailer pid 3769 invoked by uid 1000); Sat, 18 Apr 2020 08:41:14 -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] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion Date: Sat, 18 Apr 2020 11:41:12 +0300 Message-Id: <20200418084112.3723-1-insafonov@gmail.com> X-Mailer: git-send-email 2.24.1 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 --- 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.24.1