mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-23 19:28:36 +00:00
fb: Check for errors from copyin()
When compiling with gcc, a function annotated with __result_use_check cannot have its return value ignored with a void cast. So, try to handle it. MFC after: 1 week
This commit is contained in:
parent
5df041c4bb
commit
848a8bf3f4
|
@ -1732,11 +1732,15 @@ set_palette(video_adapter_t *adp, int base, int count,
|
||||||
r = malloc(count * 3, M_DEVBUF, M_WAITOK | M_ZERO);
|
r = malloc(count * 3, M_DEVBUF, M_WAITOK | M_ZERO);
|
||||||
g = r + count;
|
g = r + count;
|
||||||
b = g + count;
|
b = g + count;
|
||||||
(void)copyin(red, r, count);
|
if (copyin(red, r, count) != 0 ||
|
||||||
(void)copyin(green, g, count);
|
copyin(green, g, count) != 0 ||
|
||||||
(void)copyin(blue, b, count);
|
copyin(blue, b, count) != 0) {
|
||||||
|
error = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
error = vesa_bios_load_palette2(base, count, r, g, b, bits);
|
error = vesa_bios_load_palette2(base, count, r, g, b, bits);
|
||||||
|
out:
|
||||||
free(r, M_DEVBUF);
|
free(r, M_DEVBUF);
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
|
|
Loading…
Reference in a new issue