diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2013-03-24 14:37:41 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2013-04-02 10:25:26 +0200 |
commit | 6d20c646d600518a67f6fb93ea0c71d03e65d74a (patch) | |
tree | 4df8281758690b9ed703416fd9ce5546e64bebc5 /src | |
parent | b2eee0869fde2d0ade19005524147c035ad764ea (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_video.c b/src/gallium/drivers/nvc0/nvc0_video.c index cdb80dba064..b185ded09f0 100644 --- a/src/gallium/drivers/nvc0/nvc0_video.c +++ b/src/gallium/drivers/nvc0/nvc0_video.c @@ -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; } |