Nope. Try again.
diff --git a/rust/kernel/bitmap.rs b/rust/kernel/bitmap.rs
index 6e0824579781..2f00e91e9c35 100644
--- a/rust/kernel/bitmap.rs
+++ b/rust/kernel/bitmap.rs
@@ -551,18 +551,21 @@ fn bitmap_set_clear_find() -> Result<(), AllocError> {
Ok(())
}
- #[cfg(not(CONFIG_RUST_BITMAP_HARDENED))]
#[test]
fn owned_bitmap_out_of_bounds() -> Result<(), AllocError> {
- let mut b = BitmapVec::new(128, GFP_KERNEL)?;
+ #[cfg(not(CONFIG_RUST_BITMAP_HARDENED))]
+ {
+ let mut b = BitmapVec::new(128, GFP_KERNEL)?;
+
+ b.set_bit(2048);
+ b.set_bit_atomic(2048);
+ b.clear_bit(2048);
+ b.clear_bit_atomic(2048);
+ assert_eq!(None, b.next_bit(2048));
+ assert_eq!(None, b.next_zero_bit(2048));
+ assert_eq!(None, b.last_bit());
+ }
- b.set_bit(2048);
- b.set_bit_atomic(2048);
- b.clear_bit(2048);
- b.clear_bit_atomic(2048);
- assert_eq!(None, b.next_bit(2048));
- assert_eq!(None, b.next_zero_bit(2048));
- assert_eq!(None, b.last_bit());
Ok(())
}- [PATCH v15 2/5] rust: add bindings for bitops.h Burak Emir
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID pool and bindi... Yury Norov
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID pool and ... Miguel Ojeda
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID pool ... Yury ooNorov
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID p... Miguel Ojeda
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID p... Yury Norov
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ... Philip Li
- Re: [PATCH v15 0/5] rust: adds Bitmap ... Yury Norov
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID pool ... Dan Carpenter
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID pool ... Dan Carpenter
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ID p... Yury Norov
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ... Burak Emir
- Re: [PATCH v15 0/5] rust: adds Bitmap API, ... Miguel Ojeda
- Re: [PATCH v15 0/5] rust: adds Bitmap ... Dan Carpenter
