The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=52a99c72b5e1e58a8297d1e62854a5b765dc7d33

commit 52a99c72b5e1e58a8297d1e62854a5b765dc7d33
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2021-04-02 21:12:56 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2021-04-02 21:42:38 +0000

    sendfile: Fix error initialization in sendfile_getobj()
    
    Reviewed by:    chs, kib
    Reported by:    jhb
    Fixes:          faa998f6ff695
    MFC after:      1 day
    Differential Revision:  https://reviews.freebsd.org/D29540
---
 sys/kern/kern_sendfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 95bfba0538dc..520b7c9c62d0 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -571,6 +571,7 @@ sendfile_getobj(struct thread *td, struct file *fp, 
vm_object_t *obj_res,
        struct shmfd *shmfd;
        int error;
 
+       error = 0;
        vp = *vp_res = NULL;
        obj = NULL;
        shmfd = *shmfd_res = NULL;
@@ -610,7 +611,6 @@ sendfile_getobj(struct thread *td, struct file *fp, 
vm_object_t *obj_res,
                        VM_OBJECT_RLOCK(obj);
                }
        } else if (fp->f_type == DTYPE_SHM) {
-               error = 0;
                shmfd = fp->f_data;
                obj = shmfd->shm_object;
                VM_OBJECT_RLOCK(obj);
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to