The branch main has been updated by khng:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5c1428d2c4a63ae373181579b3af35d7e12f2e7c

commit 5c1428d2c4a63ae373181579b3af35d7e12f2e7c
Author:     Ka Ho Ng <[email protected]>
AuthorDate: 2021-08-24 14:39:43 +0000
Commit:     Ka Ho Ng <[email protected]>
CommitDate: 2021-08-24 15:49:18 +0000

    uipc_shm: Handle offset on shm_size as if it is beyond shm_size
    
    This avoids any unnecessary works in such case.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    markj, kib
    Differential Revision:  https://reviews.freebsd.org/D31655
---
 sys/kern/uipc_shm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index 60815ef24c26..c632c7f150df 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -1915,8 +1915,8 @@ shm_deallocate(struct shmfd *shmfd, off_t *offset, off_t 
*length, int flags)
        pi = OFF_TO_IDX(off + PAGE_MASK);
        error = 0;
 
-       /* Handle the case when offset is beyond shm size */
-       if ((off_t)len < 0) {
+       /* Handle the case when offset is on or beyond shm size. */
+       if ((off_t)len <= 0) {
                *offset = shmfd->shm_size;
                *length = 0;
                return (0);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to