diff options
| author | Christian Pötzsch <christian.poetzsch@kernkonzept.com> | 2026-05-12 10:39:49 +0200 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2026-05-12 12:38:49 -0600 |
| commit | 36d4c653580824b16574560b21d4401614d8b68e (patch) | |
| tree | 80532f62e58fa179573ffb78f71623fbf8893dd0 /drivers | |
| parent | a1a47eee6763e61e184d4d0cda0a3cf0922a800d (diff) | |
The virtio_blk_do_single_req function returns ulong, which normally is
the processed size, but in an error case can be the actual error. Use
the special IS_ERR_VALUE macro to test for error.
Addresses-Coverity-ID: CID 645833 (DEADCODE) & CID 645834 (NO_EFFECT)
Signed-off-by: Christian Pötzsch <christian.poetzsch@kernkonzept.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/virtio/virtio_blk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c index 45fb596a330..7b1d891cdcb 100644 --- a/drivers/virtio/virtio_blk.c +++ b/drivers/virtio/virtio_blk.c @@ -13,6 +13,7 @@ #include <virtio.h> #include <virtio_ring.h> #include <linux/log2.h> +#include <linux/err.h> #include "virtio_blk.h" #include <malloc.h> @@ -181,7 +182,7 @@ static ulong virtio_blk_do_req(struct udevice *dev, u64 sector, ret = virtio_blk_do_single_req(dev, sector + i, blk_per_sg, buffer + i * 512, type); - if (ret < 0) + if (IS_ERR_VALUE(ret)) return ret; i += blk_per_sg; } |
