mirror of
https://github.com/opnsense/src.git
synced 2026-04-27 17:17:19 -04:00
check copyin return values when loading pallete
Noticed by: Coverity Prevent analysis tool
This commit is contained in:
parent
55fa5feab7
commit
ca640ca965
1 changed files with 7 additions and 4 deletions
|
|
@ -2891,10 +2891,13 @@ set_palette(video_adapter_t *adp, int base, int count,
|
|||
r = malloc(count*3, M_DEVBUF, M_WAITOK);
|
||||
g = r + count;
|
||||
b = g + count;
|
||||
copyin(red, r, count);
|
||||
copyin(green, g, count);
|
||||
copyin(blue, b, count);
|
||||
err = vga_load_palette2(adp, base, count, r, g, b);
|
||||
err = copyin(red, r, count);
|
||||
if (!err)
|
||||
err = copyin(green, g, count);
|
||||
if (!err)
|
||||
err = copyin(blue, b, count);
|
||||
if (!err)
|
||||
err = vga_load_palette2(adp, base, count, r, g, b);
|
||||
free(r, M_DEVBUF);
|
||||
|
||||
return (err ? ENODEV : 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue