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:
parent
5fa1f5447b
commit
e4866772c3
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user