summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-04-07 07:44:01 +0000
committerhselasky <hselasky@FreeBSD.org>2016-04-07 07:44:01 +0000
commit206a1c6d9880e4552bd6091a78fd05c882f431c9 (patch)
tree1a2035740dde091d7af294c3d22faa64d0a2c2fc /sys/ofed
parent9706ffd556695ddcbcd7adedc7e67f1021081a6c (diff)
downloadFreeBSD-src-206a1c6d9880e4552bd6091a78fd05c882f431c9.zip
FreeBSD-src-206a1c6d9880e4552bd6091a78fd05c882f431c9.tar.gz
MFC r297444:
Fix bugs in currently unused bit searching loop. Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/include/linux/bitops.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ofed/include/linux/bitops.h b/sys/ofed/include/linux/bitops.h
index d3f82fe..bc8cc7b 100644
--- a/sys/ofed/include/linux/bitops.h
+++ b/sys/ofed/include/linux/bitops.h
@@ -138,11 +138,11 @@ find_last_bit(unsigned long *addr, unsigned long size)
if (mask)
return (bit + __flsl(mask));
}
- while (--pos) {
+ while (pos--) {
addr--;
bit -= BITS_PER_LONG;
if (*addr)
- return (bit + __flsl(mask));
+ return (bit + __flsl(*addr));
}
return (size);
}
OpenPOWER on IntegriCloud