From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLPX7-0007FM-W5 for ath10k@lists.infradead.org; Tue, 30 Apr 2019 09:58:43 +0000 MIME-Version: 1.0 Date: Tue, 30 Apr 2019 15:28:40 +0530 From: Tamizh chelvam Subject: Re: [PATCHv5 5/9] nl80211: Add netlink attribute to configure TID specific tx rate In-Reply-To: References: <1553592550-15282-1-git-send-email-tamizhr@codeaurora.org> <1553592550-15282-6-git-send-email-tamizhr@codeaurora.org> Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Johannes Berg Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org On 2019-04-26 15:07, Johannes Berg wrote: >> @@ -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? > Yeah. I will fix this in next version. _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64D08C43219 for ; Tue, 30 Apr 2019 09:58:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 315BB2075E for ; Tue, 30 Apr 2019 09:58:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="gMQbRksY"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="gMQbRksY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfD3J6l (ORCPT ); Tue, 30 Apr 2019 05:58:41 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40416 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfD3J6l (ORCPT ); Tue, 30 Apr 2019 05:58:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 86E5F608BA; Tue, 30 Apr 2019 09:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1556618320; bh=/OB55PwLiN+VY5sC2w4AVwUugT8v9nOotaENEpSmz7g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gMQbRksY8T57Ip78YeZvtOJRdCC1Za9wYgJ7tJJJhqhXWd3NAroPEPrCA4vSniv9k rLBDD0fGjVCkcCGFHWcrgu/nN6pN4Azd2dNhUr5/oL1SQTKo8LQzoJYNJ7kuKV1gtQ XMvlI0OF/zImV7UllUC2yA3v8lE90cnelV5kInTw= Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 35A49607DF; Tue, 30 Apr 2019 09:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1556618320; bh=/OB55PwLiN+VY5sC2w4AVwUugT8v9nOotaENEpSmz7g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gMQbRksY8T57Ip78YeZvtOJRdCC1Za9wYgJ7tJJJhqhXWd3NAroPEPrCA4vSniv9k rLBDD0fGjVCkcCGFHWcrgu/nN6pN4Azd2dNhUr5/oL1SQTKo8LQzoJYNJ7kuKV1gtQ XMvlI0OF/zImV7UllUC2yA3v8lE90cnelV5kInTw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 30 Apr 2019 15:28:40 +0530 From: Tamizh chelvam To: Johannes Berg Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [PATCHv5 5/9] nl80211: Add netlink attribute to configure TID specific tx rate In-Reply-To: References: <1553592550-15282-1-git-send-email-tamizhr@codeaurora.org> <1553592550-15282-6-git-send-email-tamizhr@codeaurora.org> Message-ID: X-Sender: tamizhr@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2019-04-26 15:07, Johannes Berg wrote: >> @@ -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? > Yeah. I will fix this in next version.