From patchwork Sat May 30 23:24:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 6514511 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0329FC0020 for ; Sat, 30 May 2015 23:30:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFEBE20776 for ; Sat, 30 May 2015 23:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBFD020739 for ; Sat, 30 May 2015 23:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598AbbE3XYr (ORCPT ); Sat, 30 May 2015 19:24:47 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:34797 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbbE3XYq (ORCPT ); Sat, 30 May 2015 19:24:46 -0400 Received: by pdbki1 with SMTP id ki1so79895382pdb.1 for ; Sat, 30 May 2015 16:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Mi2+j3oClU/F665Bo94+U942OGUbVbxrNKOWzPzs0f4=; b=yzPto8AAme1Rs5DbtTcZzQlpUtnkbGvFmlBMeMGpaBRu4jssBiZRaVMKZvu8zJ/KI0 xeBgM8QWlG2XIWyhyQtc73w9mqD3yYc8ib9WuIsrJFVNFT1hArUJYg9ZHaa5PYdGTFmK cKP9N2NzG2NrDFpe87AJc6IaNPWvqGQ2jMJzAWYQNF05Dh0rwLLowQ6bF7h771SJrank 2dKh6oZWMDiLQYc4o/zdtTNGAHsKNtBCrtVR/HHzjBFkuEvqKwLRjNfYk8vFrpR0Qpwr QcoiPe2NPH3MIhSfsXzTPU0gFs3TlbiJGbF+NxD48GgMhwI8QNlTLo6zLbMBXSFwvnQ5 dbWw== X-Received: by 10.66.144.40 with SMTP id sj8mr26997379pab.55.1433028286175; Sat, 30 May 2015 16:24:46 -0700 (PDT) Received: from localhost.localdomain ([183.82.211.120]) by mx.google.com with ESMTPSA id cu8sm9789799pad.1.2015.05.30.16.24.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 May 2015 16:24:44 -0700 (PDT) From: Chaitanya T K To: linux-wireless , Johannes Berg Cc: Chaitanya T K Subject: [PATCH] cfg80211: Don't re-use the skb for larger NL messages. Date: Sun, 31 May 2015 04:54:35 +0530 Message-Id: <1433028275-9576-1-git-send-email-chaitanya.mgit@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This improves the time to get the DUMP response across to user space. Signed-off-by: Chaitanya T K --- net/wireless/nl80211.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c264eff..152bd0c 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -7636,6 +7636,10 @@ static int nl80211_testmode_dump(struct sk_buff *skb, } genlmsg_end(skb, hdr); + + /* Don't re-use skb, when we know nla_put fails*/ + if (skb->len > NLMSG_GOODSIZE / 2) + break; } err = skb->len;