Skip to content

Commit 0315fef

Browse files
longlimsftliuw
authored andcommitted
uio_hv_generic: Align ring size to system page
Following the ring header, the ring data should align to system page boundary. Adjust the size if necessary. Cc: [email protected] Fixes: 95096f2 ("uio-hv-generic: new userspace i/o driver for VMBus") Signed-off-by: Long Li <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent c951ab8 commit 0315fef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/uio/uio_hv_generic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ hv_uio_probe(struct hv_device *dev,
243243
if (!ring_size)
244244
ring_size = SZ_2M;
245245

246+
/* Adjust ring size if necessary to have it page aligned */
247+
ring_size = VMBUS_RING_SIZE(ring_size);
248+
246249
pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL);
247250
if (!pdata)
248251
return -ENOMEM;

0 commit comments

Comments
 (0)