linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Tamizh chelvam <tamizhr@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/3] mac80211: Implement API to configure station specific rssi threshold
Date: Fri, 09 Nov 2018 12:49:26 +0100	[thread overview]
Message-ID: <f1c8ce7daf62c60197da9cc62d550fdc1cac6303.camel@sipsolutions.net> (raw)
In-Reply-To: <1539626250-769-3-git-send-email-tamizhr@codeaurora.org>

On Mon, 2018-10-15 at 23:27 +0530, Tamizh chelvam wrote:
> 
> +		sta_mon_rssi_config_free(sta);
> +		sta->rssi_hyst = rssi_hyst;
> +		if (fixed_thold) {
> +			if (n_rssi_tholds > 2) {
> +				ret = -EINVAL;
> +				goto out;
> +			}

This might be slightly wrong, you free and then can still return an
error.

> +			if (n_rssi_tholds == 1) {
> +				sta->rssi_low = rssi_tholds[0];
> +				sta->rssi_high = rssi_tholds[0];
> +			} else {
> +				sta->rssi_low = rssi_tholds[0];
> +				sta->rssi_high = rssi_tholds[1];
> +			}
> +		} else {
> +			const s32 *rssi_tholds;
> +
> +			rssi_tholds = kmemdup(rssi_tholds,
> +					      n_rssi_tholds * sizeof(s32),
> +					      GFP_KERNEL);
> +			if (!rssi_tholds) {
> +				ret = -ENOMEM;
> +				goto out;
> +			}

Similarly here, I guess you should do the allocation (and other error
checking) before freeing.

> +			sta->rssi_tholds = rssi_tholds;
> +			sta->n_rssi_tholds = n_rssi_tholds;
> +			ieee80211_update_rssi_config(sta);



> +struct sta_mon_rssi_config {
> +};

Huh?


The commit log also makes it sounds like mac80211 actually *supports*
this, but clearly that's not the case. However you don't give any data
to the driver either, did you lose a patch along the way? Previously you
had patch 5 ("mac80211: Implement functionality to monitor station's
rssi cross event") and if I remember correctly I said you should squash
some, but now that's not here?

johannes


  reply	other threads:[~2018-11-09 11:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 17:57 [PATCH 0/3] cfg80211/mac80211: Add support to configure and monitor station's rssi threshold Tamizh chelvam
2018-10-15 17:57 ` [PATCH 1/3] cfg80211: Add support to configure station specific RSSI threshold for AP mode Tamizh chelvam
2018-10-16 11:28   ` Sergey Matyukevich
2018-10-16 12:47     ` [EXTERNAL] " Tamizh Chelvam Raja
2018-11-09 11:44   ` Johannes Berg
2018-11-11 13:34     ` Tamizh chelvam
2018-10-15 17:57 ` [PATCH 2/3] mac80211: Implement API to configure station specific rssi threshold Tamizh chelvam
2018-11-09 11:49   ` Johannes Berg [this message]
2018-11-11 13:57     ` Tamizh chelvam
2018-10-15 17:57 ` [PATCH 3/3] mac80211: Implement functionality to monitor station's signal stregnth Tamizh chelvam
2018-10-16 11:49   ` Sergey Matyukevich
2018-11-09 11:55   ` Johannes Berg
2018-11-11 14:03     ` Tamizh chelvam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1c8ce7daf62c60197da9cc62d550fdc1cac6303.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tamizhr@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).