Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc DRM fixes #1548

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sys/dev/drm/freebsd/drm_os_freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ drm_fstub_ioctl(struct file *file, u_long cmd, void *data, struct ucred *cred,
goto out_release;
}

rv = fops->unlocked_ioctl(file, cmd, (uintcap_t)PTR2CAP(data));
rv = -fops->unlocked_ioctl(file, cmd, (uintcap_t)PTR2CAP(data));

dev_relthread(cdev, ref);
return (rv);
Expand Down
4 changes: 2 additions & 2 deletions sys/libkern/bcopy_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ memcpy_c(void * __capability dst0, const void * __capability src0, size_t len)
(void *)(__cheri_addr uintptr_t)src));

/* Copy capabilities. */
while (len > sizeof(uintcap_t)) {
while (len >= sizeof(uintcap_t)) {
*(uintcap_t * __capability)dst =
*(const uintcap_t * __capability)src;
dst += sizeof(uintcap_t);
Expand Down Expand Up @@ -118,7 +118,7 @@ memcpy_c(void * __capability dst0, const void * __capability src0, size_t len)
("src %p not aligned", (void *)(__cheri_addr uintptr_t)src));

/* Copy capabilities. */
while (len > sizeof(uintcap_t)) {
while (len >= sizeof(uintcap_t)) {
dst -= sizeof(uintcap_t);
src -= sizeof(uintcap_t);
*(uintcap_t * __capability)dst =
Expand Down