Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4700083yba; Tue, 30 Apr 2019 02:59:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeujLXKuiIRo82tzi1b6Nfr6pC7Hz6KEC5z29S8iBdMnGHUrAWRFonoiYHr4IRDxoNpv1R X-Received: by 2002:a65:4183:: with SMTP id a3mr64952128pgq.121.1556618347092; Tue, 30 Apr 2019 02:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556618347; cv=none; d=google.com; s=arc-20160816; b=B6YzkzDglaMtMGBy6IPKj3cDaRg69whlWUsy6CvPH49I3V+eHtINWXHEKVZA41UAsV V6wVeJBjs0R5pThWOW2MGJE8CeCmhlAahlgrU1aTCIgkMstVe/G3xo9akujJyCFVddSi Di7inhNlN0hRb8Q6g0yzoGcXdW/soGsiIqTW6LXh4HE8r1139l1AjULxi9dMbmN5NPrn WOqByZBPJfIIRq/rjf4Gaxnkh4MJfl72na3nYlxWX/VfKoCmPgZ7kta3ljZzQJwyAcv0 bTuSeTNvaMGcVF7jvEsh8nN3cTye0jFRZHgd5Q26E/skzRzT70nldBcW/sMXVwKMKTdr 9kag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=BnerySD39Zh17EqGsZynSBzW1TSdFoi1vrPU55KX1Dg=; b=cqTA9Vf2YSaJuuR8bGfNczoCcCZxy4xo2hcL9Jx616Q+LnvcMZXkvAiq0Td8mvWuRh vu+2MbyYpyzk4vcl5saEufeFGxByI3+FlUbYlKj4dB0xVhGAcY2rKJK2+rzBB7KaN/KD mEhm+nTrknMPbdiMNHEuBPNG24d91s7qffsg/H5YGOl++iuCfoeJaRVvVYswM25xZHPl LqMCp3bJ6hdvWwweHZLLs0PsrcVz4Gp7CzjgyEnNxVdKUHFQWg8TjoiG+s1XkWOZXyc+ OYmGBKV9/YaXMRysXygI01ZgeOrUR8XfDYCMpAPahgO8oT0p/UOa3K0c997zQULShGyY A2Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=gMQbRksY; dkim=pass header.i=@codeaurora.org header.s=default header.b=gMQbRksY; 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 e8si11863282pgm.282.2019.04.30.02.58.52; Tue, 30 Apr 2019 02:59:07 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=gMQbRksY; dkim=pass header.i=@codeaurora.org header.s=default header.b=gMQbRksY; 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 S1726700AbfD3J6l (ORCPT + 99 others); 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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 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.