File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -623,7 +623,7 @@ static void __virtio_snd_frame_dequeue(void *out,
623623
624624 /* Copy the frame to output stream */
625625 uint32_t size = props -> ring .cons .size ;
626- uint32_t idx = cons_head & mask ;
626+ uint32_t idx = cons_head % size ;
627627 fprintf (stderr ,
628628 "cons_head %" PRIu32 " cons_next %" PRIu32 " mask %" PRIu32
629629 " idx %" PRIu32 "\n" ,
@@ -810,7 +810,7 @@ static void __virtio_snd_frame_enqueue(void *payload,
810810
811811 /* Write payload to ring buffer. */
812812 uint32_t size = props -> ring .prod .size ;
813- uint32_t idx = prod_head & mask ;
813+ uint32_t idx = prod_head % size ;
814814 fprintf (stderr ,
815815 "prod_head %" PRIu32 " prod_next %" PRIu32 " mask %" PRIu32
816816 " idx %" PRIu32 "\n" ,
You can’t perform that action at this time.
0 commit comments