sendfile: Fix error initialization in sendfile_getobj()

Reviewed by:	chs, kib
Reported by:	jhb
Fixes:		faa998f6ff
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D29540
This commit is contained in:
Mark Johnston 2021-04-02 17:12:56 -04:00
parent fc56fd262d
commit 52a99c72b5

View File

@ -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);