File tree Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 3737 toolchain : ${{ matrix.rust }}
3838 target : ${{ matrix.target }}
3939
40+ - if : ${{ matrix.rust=='1.65.0' }}
41+ run : cargo update --precise 2.0.106 --package syn
42+
4043 - name : Install armv7 libraries
4144 if : ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
4245 run : |
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
88## [ Unreleased]
99
10+ ## [ v0.4.1] - 2025-11-06
11+
12+ ### Fixed
13+
14+ - Fix UB (and remove unsafe block) in handling of SpiOperation::TransferInPlace
15+
1016## [ v0.4.0] - 2024-01-10
1117
1218### Changed
@@ -152,7 +158,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
152158
153159Initial release
154160
155- [ Unreleased ] : https://github.com/rust-embedded/linux-embedded-hal/compare/v0.4.0...HEAD
161+ [ Unreleased ] : https://github.com/rust-embedded/linux-embedded-hal/compare/v0.4.1...HEAD
162+ [ v0.4.1 ] : https://github.com/rust-embedded/linux-embedded-hal/compare/v0.4.0...v0.4.1
156163[ v0.4.0 ] : https://github.com/rust-embedded/linux-embedded-hal/compare/v0.4.0-alpha.4...v0.4.0
157164[ v0.4.0-alpha.4 ] : https://github.com/rust-embedded/linux-embedded-hal/compare/v0.4.0-alpha.3...v0.4.0-alpha.4
158165[ v0.4.0-alpha.3 ] : https://github.com/rust-embedded/linux-embedded-hal/compare/v0.4.0-alpha.2...v0.4.0-alpha.3
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ keywords = ["Linux", "hal"]
99license = " MIT OR Apache-2.0"
1010name = " linux-embedded-hal"
1111repository = " https://github.com/rust-embedded/linux-embedded-hal"
12- version = " 0.4.0 "
12+ version = " 0.4.1 "
1313edition = " 2018"
1414
1515[features ]
@@ -29,7 +29,7 @@ sysfs_gpio = { version = "0.6.1", optional = true }
2929i2cdev = { version = " 0.6.0" , optional = true }
3030nb = " 1"
3131serialport = { version = " 4.2.0" , default-features = false }
32- spidev = { version = " 0.6.0 " , optional = true }
32+ spidev = { version = " 0.6.1 " , optional = true }
3333nix = " 0.27.1"
3434
3535[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -173,9 +173,8 @@ mod embedded_hal_impl {
173173 }
174174
175175 fn transfer_in_place ( & mut self , words : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > {
176- let tx = words. to_owned ( ) ;
177176 self . 0
178- . transfer ( & mut SpidevTransfer :: read_write ( & tx , words) )
177+ . transfer ( & mut SpidevTransfer :: read_write_in_place ( words) )
179178 . map_err ( |err| SPIError { err } )
180179 }
181180
@@ -214,11 +213,7 @@ mod embedded_hal_impl {
214213 }
215214 } ,
216215 SpiOperation :: TransferInPlace ( buf) => {
217- let tx = unsafe {
218- let p = buf. as_ptr ( ) ;
219- std:: slice:: from_raw_parts ( p, buf. len ( ) )
220- } ;
221- transfers. push ( SpidevTransfer :: read_write ( tx, buf) ) ;
216+ transfers. push ( SpidevTransfer :: read_write_in_place ( buf) ) ;
222217 }
223218 SpiOperation :: DelayNs ( ns) => {
224219 let us = {
You can’t perform that action at this time.
0 commit comments