Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Apr 2021 15:14:13 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 69f4805c3698 - stable/13 - sendfile: Fix error initialization in sendfile_getobj()
Message-ID:  <202104031514.133FED2n089275@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=69f4805c3698407a7cb3e107e37823c08419915d

commit 69f4805c3698407a7cb3e107e37823c08419915d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-04-02 21:12:56 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-04-03 15:11:39 +0000

    sendfile: Fix error initialization in sendfile_getobj()
    
    Reviewed by:    chs, kib
    Reported by:    jhb
    Fixes:          faa998f6ff695
    Differential Revision:  https://reviews.freebsd.org/D29540
    
    (cherry picked from commit 52a99c72b5e1e58a8297d1e62854a5b765dc7d33)
---
 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104031514.133FED2n089275>