Staging: rt2860: Fix test in rt_ioctl_siwfrag()
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 25 Aug 2009 12:31:11 +0000 (14:31 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:02:24 +0000 (12:02 -0700)
The test always evaluated to true.

MIN_FRAG_THRESHOLD is defined 256,
MAX_FRAG_THRESHOLD is defined 2346

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rt2860/sta_ioctl.c

index b6cdf13..c0e0425 100644 (file)
@@ -1369,8 +1369,8 @@ int rt_ioctl_siwfrag(struct net_device *dev,
 
        if (frag->disabled)
                val = MAX_FRAG_THRESHOLD;
-       else if (frag->value >= MIN_FRAG_THRESHOLD || frag->value <= MAX_FRAG_THRESHOLD)
-        val = __cpu_to_le16(frag->value & ~0x1); /* even numbers only */
+       else if (frag->value >= MIN_FRAG_THRESHOLD && frag->value <= MAX_FRAG_THRESHOLD)
+               val = __cpu_to_le16(frag->value & ~0x1); /* even numbers only */
        else if (frag->value == 0)
            val = MAX_FRAG_THRESHOLD;
        else