Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/v3d: Prefer get_user for scalar types

It makes it just a tiny bit more obvious what is going on.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240711135340.84617-11-tursulin@igalia.com

authored by

Tvrtko Ursulin and committed by
Maíra Canal
96bc9049 3ef80d4e

+5 -5
+5 -5
drivers/gpu/drm/v3d/v3d_submit.c
··· 485 485 for (i = 0; i < timestamp.count; i++) { 486 486 u32 offset, sync; 487 487 488 - if (copy_from_user(&offset, offsets++, sizeof(offset))) { 488 + if (get_user(offset, offsets++)) { 489 489 err = -EFAULT; 490 490 goto error; 491 491 } 492 492 493 493 job->timestamp_query.queries[i].offset = offset; 494 494 495 - if (copy_from_user(&sync, syncs++, sizeof(sync))) { 495 + if (get_user(sync, syncs++)) { 496 496 err = -EFAULT; 497 497 goto error; 498 498 } ··· 550 550 551 551 job->timestamp_query.queries[i].offset = reset.offset + 8 * i; 552 552 553 - if (copy_from_user(&sync, syncs++, sizeof(sync))) { 553 + if (get_user(sync, syncs++)) { 554 554 err = -EFAULT; 555 555 goto error; 556 556 } ··· 611 611 for (i = 0; i < copy.count; i++) { 612 612 u32 offset, sync; 613 613 614 - if (copy_from_user(&offset, offsets++, sizeof(offset))) { 614 + if (get_user(offset, offsets++)) { 615 615 err = -EFAULT; 616 616 goto error; 617 617 } 618 618 619 619 job->timestamp_query.queries[i].offset = offset; 620 620 621 - if (copy_from_user(&sync, syncs++, sizeof(sync))) { 621 + if (get_user(sync, syncs++)) { 622 622 err = -EFAULT; 623 623 goto error; 624 624 }