Make the error return from mem_range_attr_get actually do something useful
(return an error to the caller)
This commit is contained in:
parent
0c5ed04869
commit
ac3595b017
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50677
@ -429,8 +429,9 @@ mem_ioctl(dev, cmd, data, flags, p)
|
||||
md = (struct mem_range_desc *)
|
||||
malloc(nd * sizeof(struct mem_range_desc),
|
||||
M_MEMDESC, M_WAITOK);
|
||||
mem_range_attr_get(md, &nd);
|
||||
error = copyout(md, mo->mo_desc,
|
||||
error = mem_range_attr_get(md, &nd);
|
||||
if (!error)
|
||||
error = copyout(md, mo->mo_desc,
|
||||
nd * sizeof(struct mem_range_desc));
|
||||
free(md, M_MEMDESC);
|
||||
} else {
|
||||
@ -460,7 +461,7 @@ mem_ioctl(dev, cmd, data, flags, p)
|
||||
* Implementation-neutral, kernel-callable functions for manipulating
|
||||
* memory range attributes.
|
||||
*/
|
||||
void
|
||||
int
|
||||
mem_range_attr_get(mrd, arg)
|
||||
struct mem_range_desc *mrd;
|
||||
int *arg;
|
||||
@ -474,6 +475,7 @@ mem_range_attr_get(mrd, arg)
|
||||
} else {
|
||||
bcopy(mem_range_softc.mr_desc, mrd, (*arg) * sizeof(struct mem_range_desc));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -429,8 +429,9 @@ mem_ioctl(dev, cmd, data, flags, p)
|
||||
md = (struct mem_range_desc *)
|
||||
malloc(nd * sizeof(struct mem_range_desc),
|
||||
M_MEMDESC, M_WAITOK);
|
||||
mem_range_attr_get(md, &nd);
|
||||
error = copyout(md, mo->mo_desc,
|
||||
error = mem_range_attr_get(md, &nd);
|
||||
if (!error)
|
||||
error = copyout(md, mo->mo_desc,
|
||||
nd * sizeof(struct mem_range_desc));
|
||||
free(md, M_MEMDESC);
|
||||
} else {
|
||||
@ -460,7 +461,7 @@ mem_ioctl(dev, cmd, data, flags, p)
|
||||
* Implementation-neutral, kernel-callable functions for manipulating
|
||||
* memory range attributes.
|
||||
*/
|
||||
void
|
||||
int
|
||||
mem_range_attr_get(mrd, arg)
|
||||
struct mem_range_desc *mrd;
|
||||
int *arg;
|
||||
@ -474,6 +475,7 @@ mem_range_attr_get(mrd, arg)
|
||||
} else {
|
||||
bcopy(mem_range_softc.mr_desc, mrd, (*arg) * sizeof(struct mem_range_desc));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -60,7 +60,7 @@ struct mem_range_softc
|
||||
|
||||
extern struct mem_range_softc mem_range_softc;
|
||||
|
||||
extern void mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
|
||||
extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
|
||||
extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
|
||||
extern void mem_range_AP_init(void);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user