mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02: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>
(cherry picked from commit 6d20c646d6)
This commit is contained in:
parent
46ac963a23
commit
09f5ee9918
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