Skip to content

Commit

Permalink
sensor: fix assertion
Browse files Browse the repository at this point in the history
With rtio_sqe_prep_read() buf is assigned to userdata. The __ASSERT
should check if the same userdata arrived with rtio_cqe_consume_block()$

(cherry picked from commit 4d4938f)

Original-Signed-off-by: Mirko Becker <mirko.becker@phoenixcontact.com>
GitOrigin-RevId: 4d4938f
Cr-Build-Id: 8733565196572304993
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8733565196572304993
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: Ic9386e5bedc95126ff8a80c85f5ff35013999b23
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5942570
Tested-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
  • Loading branch information
mirkobeckerPxC authored and Chromeos LUCI committed Oct 28, 2024
1 parent fb81c90 commit 4a98e5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/zephyr/drivers/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ static inline int sensor_read(struct rtio_iodev *iodev, struct rtio *ctx, uint8_
struct rtio_cqe *cqe = rtio_cqe_consume_block(ctx);
int res = cqe->result;

__ASSERT(cqe->userdata != buf,
__ASSERT(cqe->userdata == buf,
"consumed non-matching completion for sensor read into buffer %p\n", buf);

rtio_cqe_release(ctx, cqe);
Expand Down

0 comments on commit 4a98e5d

Please sign in to comment.