All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix failed to set smps
@ 2015-03-27  5:21 miaoqing
  2015-03-30  8:43 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: miaoqing @ 2015-03-27  5:21 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Miaoqing Pan

From: Miaoqing Pan <miaoqing@qca.qualcomm.com>

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
---
 net/mac80211/debugfs_netdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 4d7473f..9aeb50d 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -276,7 +276,8 @@ static ssize_t ieee80211_if_parse_smps(struct ieee80211_sub_if_data *sdata,
 	enum ieee80211_smps_mode mode;
 
 	for (mode = 0; mode < IEEE80211_SMPS_NUM_MODES; mode++) {
-		if (strncmp(buf, smps_modes[mode], buflen) == 0) {
+		if (strncmp(buf, smps_modes[mode],
+			    strlen(smps_modes[mode])) == 0) {
 			int err = ieee80211_set_smps(sdata, mode);
 			if (!err)
 				return buflen;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: fix failed to set smps
  2015-03-27  5:21 [PATCH] mac80211: fix failed to set smps miaoqing
@ 2015-03-30  8:43 ` Johannes Berg
  2015-03-30  9:34   ` Krishna Chaitanya
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2015-03-30  8:43 UTC (permalink / raw)
  To: miaoqing; +Cc: linville, linux-wireless, ath9k-devel

On Fri, 2015-03-27 at 13:21 +0800, miaoqing@qti.qualcomm.com wrote:
> From: Miaoqing Pan <miaoqing@qca.qualcomm.com>
> 
> Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>

Since you give no commit log, I can only guess what you're trying to do,
but I suppose you need to use "echo -n" instead of "echo".

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: fix failed to set smps
  2015-03-30  8:43 ` Johannes Berg
@ 2015-03-30  9:34   ` Krishna Chaitanya
  2015-03-30 10:06     ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Krishna Chaitanya @ 2015-03-30  9:34 UTC (permalink / raw)
  To: Johannes Berg; +Cc: miaoqing, John Linville, linux-wireless, ath9k-devel

On Mon, Mar 30, 2015 at 2:13 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Fri, 2015-03-27 at 13:21 +0800, miaoqing@qti.qualcomm.com wrote:
>> From: Miaoqing Pan <miaoqing@qca.qualcomm.com>
>>
>> Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
>
> Since you give no commit log, I can only guess what you're trying to do,
> but I suppose you need to use "echo -n" instead of "echo".
Johannes,

We had this discussion earlier also, i still strongly feel all cases
must work with "echo" by default, as people are not that familiar
to use "echo -n".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: fix failed to set smps
  2015-03-30  9:34   ` Krishna Chaitanya
@ 2015-03-30 10:06     ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2015-03-30 10:06 UTC (permalink / raw)
  To: Krishna Chaitanya; +Cc: miaoqing, John Linville, linux-wireless, ath9k-devel

On Mon, 2015-03-30 at 15:04 +0530, Krishna Chaitanya wrote:
> On Mon, Mar 30, 2015 at 2:13 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Fri, 2015-03-27 at 13:21 +0800, miaoqing@qti.qualcomm.com wrote:
> >> From: Miaoqing Pan <miaoqing@qca.qualcomm.com>
> >>
> >> Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
> >
> > Since you give no commit log, I can only guess what you're trying to do,
> > but I suppose you need to use "echo -n" instead of "echo".
> Johannes,
> 
> We had this discussion earlier also, i still strongly feel all cases
> must work with "echo" by default, as people are not that familiar
> to use "echo -n".

Well I still strongly feel that accepting garbage on the input like this
patch will do is wrong.

johannes



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-30 10:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27  5:21 [PATCH] mac80211: fix failed to set smps miaoqing
2015-03-30  8:43 ` Johannes Berg
2015-03-30  9:34   ` Krishna Chaitanya
2015-03-30 10:06     ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.