Check the result of copyin and in a case of error

return one. This prevents setting wrong priority
or (more likely) returning EINVAL.

Approved by:	kib (mentor)
This commit is contained in:
Roman Divacky 2008-10-13 21:04:52 +00:00
parent 5fa1f5447b
commit e4866772c3

View File

@ -126,6 +126,8 @@ kern_thr_new(struct thread *td, struct thr_param *param)
rtpp = NULL;
if (param->rtp != 0) {
error = copyin(param->rtp, &rtp, sizeof(struct rtprio));
if (error)
return (error);
rtpp = &rtp;
}
error = create_thread(td, NULL, param->start_func, param->arg,