Skip to content

Commit cdeed70

Browse files
author
Ionut Rosca
committed
fix the length check for read operation
1 parent 3388123 commit cdeed70

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

capsules/core/src/spi_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ impl<'a, S: SpiMasterDevice<'a>> SyscallDriver for Spi<'a, S> {
369369
.get_readwrite_processbuffer(rw_allow::READ)
370370
.map_or(0, |read| read.len());
371371

372-
if rlen >= arg1 && rlen > 0 {
372+
if rlen >= arg1 && arg1 > 0 {
373373
app.len = arg1;
374374
app.index = 0;
375375
self.busy.set(true);

0 commit comments

Comments
 (0)