Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp430850yba; Fri, 26 Apr 2019 02:37:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS0AFgfbUdtM0dQ9hGLk6AGJeUo2SXHZkaZ2dRw0XFYSFqXePeAmgsXEO1H+Dsg+LAFv2M X-Received: by 2002:a17:902:2965:: with SMTP id g92mr45294876plb.267.1556271479169; Fri, 26 Apr 2019 02:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556271479; cv=none; d=google.com; s=arc-20160816; b=DeLxBo6jSdBVzMrYoNTEftpxUExVJhemHv9s0GvNSeJ+5/00fahatUCjvopaWE6ktJ IA4K+sPQ8NB50GwAa3ibtKzd8KNbf1Ooi+MWeLzqTgzDIqggveYLxA9VUxoK4r5oGT/q aJPZll5II1aR4iFuK36++kIBnLrMpydiBieI/hOp+sUrvO+75TyjCner+hGfRPT0o+T5 AW9cNUUurcvjbjV23gVL/75Yak+vId+pJl9zs+u3443KTi9okNjhl+UtFmDT+0Kpwfj7 TPBmbQNQwmqY0E67Owti998xaJ7ilDP96NMq7G3sK+0pFvMEHqbZ2jBjXFJW69K5LKWH 3QmA== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=dZMs9JBArTvGQ8OjZSkGCfJEsqvxfwu1pk9NOuXoMnc=; b=EuhKx/E/74j4neMv6477K4VVx6r4MRzTKKm445H0geKeAq4IyOqNIyXRhge6ztLbBN xUAq7fqZLkSJ4hF1rF80biqv8WFLZD8sA+msRj6KzHp/Cs8seSa1Knm0VXBZs8y0PSJj r3FYjfMQ/taZ3v/B7r+ApCKmRrlt2JSCZ0FuIWGlv0dp0ZRw1UvLsSxdoCjiB0J7tiWR +kssdB2xN028sd3CXEtWisDlDcIr17uKP4SuyB+G18hAk+4ake8wUVbNfC/sSQ6jesuW j/tw0nSxzlCY0KuFLpTNjEfT//1CI+g9UB/zJKqBfoGgcIBPBwsbhoITjELzYAszmo+h IZ+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si22904663pgw.384.2019.04.26.02.37.44; Fri, 26 Apr 2019 02:37:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726077AbfDZJhi (ORCPT + 99 others); Fri, 26 Apr 2019 05:37:38 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:54414 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfDZJhg (ORCPT ); Fri, 26 Apr 2019 05:37:36 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hJxIT-0007qn-8m; Fri, 26 Apr 2019 11:37:33 +0200 Message-ID: Subject: Re: [PATCHv5 5/9] nl80211: Add netlink attribute to configure TID specific tx rate From: Johannes Berg To: Tamizh chelvam , ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Date: Fri, 26 Apr 2019 11:37:32 +0200 In-Reply-To: <1553592550-15282-6-git-send-email-tamizhr@codeaurora.org> References: <1553592550-15282-1-git-send-email-tamizhr@codeaurora.org> <1553592550-15282-6-git-send-email-tamizhr@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > @@ -13354,6 +13367,42 @@ static int parse_tid_conf(struct cfg80211_registered_device *rdev, > nla_get_u8(attrs[NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL]); > } > > + if (attrs[NL80211_ATTR_TID_CONFIG_TX_RATES_TYPE]) { > + int idx; > + enum nl80211_attrs attr; > + > + if (!wiphy_ext_feature_isset(&rdev->wiphy, > + NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK)) > + return -EOPNOTSUPP; > + > + if (peer && > + !wiphy_ext_feature_isset(&rdev->wiphy, > + NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK)) > + return -EOPNOTSUPP; > + > + idx = NL80211_ATTR_TID_CONFIG_TX_RATES_TYPE; > + tid_conf->txrate_type = nla_get_u8(attrs[idx]); > + > + tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_TX_BITRATE; > + if (tid_conf->txrate_type != NL80211_TX_RATE_AUTOMATIC) { > + tid_conf->mask = > + kzalloc(sizeof(struct cfg80211_bitrate_mask), > + GFP_KERNEL); You leak this > + if (!tid_conf->mask) > + return -ENOMEM; > + > + attr = NL80211_ATTR_TID_CONFIG_TX_RATES; > + ret = nl80211_parse_tx_bitrate_mask(attrs, rdev, attr, > + tid_conf->mask); > + if (ret) { > + kfree(tid_conf->mask); > + return ret; > + } > + } else { > + tid_conf->mask = NULL; > + } > + } > + > return 0; > } > > @@ -13407,7 +13456,7 @@ static int nl80211_set_tid_config(struct sk_buff *skb, > } > > ret = parse_tid_conf(rdev, attrs, &tid_conf->tid_conf[conf_idx], > - tid_conf->peer); > + info, tid_conf->peer); > if (ret) > goto bad_tid_conf; Practically everywhere, but particularly in the bad case in the next loop iteration etc? johannes