mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 17:00:13 +01:00
nvc0: Fix fd leak in nvc0_create_decoder
NOTE: This is a candidate for the 9.0 and 9.1 branches. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
This commit is contained in:
parent
b2eee0869f
commit
6d20c646d6
1 changed files with 2 additions and 2 deletions
|
|
@ -356,19 +356,19 @@ nvc0_create_decoder(struct pipe_context *context,
|
|||
goto fw_fail;
|
||||
}
|
||||
r = read(fd, dec->fw_bo->map, 0x4000);
|
||||
close(fd);
|
||||
|
||||
if (r < 0) {
|
||||
fprintf(stderr, "reading firmware file %s failed: %m\n", path);
|
||||
goto fw_fail;
|
||||
}
|
||||
|
||||
if (r == 0x4000) {
|
||||
close(fd);
|
||||
fprintf(stderr, "firmware file %s too large!\n", path);
|
||||
goto fw_fail;
|
||||
}
|
||||
|
||||
if (r & 0xff) {
|
||||
close(fd);
|
||||
fprintf(stderr, "firmware file %s wrong size!\n", path);
|
||||
goto fw_fail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue