summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-03-25 14:32:42 -0600
committerTom Rini <[email protected]>2026-03-25 14:32:42 -0600
commitb8e6c5d0ddc18c739fa3d2b8a78abbfc265909f3 (patch)
tree0a0ae74997746ba1affd1619d8816baee2714665 /drivers
parentfce0358351017ab88987e40ad887670463373e7e (diff)
parente0eef12a1f46bf946e24050a1da0f067c3952b89 (diff)
Merge patch series "virtio: rng: Handle oversized return buffers"
Meet Patel <[email protected]> says: The virtio-rng test to verify effective handling of oversized return buffers checks that an (undocumented) error is raised, instead of the real concern, which is the surrounding buffer integrity following a rng function call. Update the test to check that the other contents of a buffer remain unchanged instead of looking for an error code. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/virtio/virtio_rng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_rng.c b/drivers/virtio/virtio_rng.c
index 90a371a59cc..c6de62142bb 100644
--- a/drivers/virtio/virtio_rng.c
+++ b/drivers/virtio/virtio_rng.c
@@ -46,7 +46,7 @@ static int virtio_rng_read(struct udevice *dev, void *data, size_t len)
;
if (rsize > sg.length)
- return -EIO;
+ rsize = sg.length;
memcpy(ptr, buf, rsize);
len -= rsize;