intel: gen decoder: don't check for size_t negative values
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 8 May 2017 17:47:06 +0000 (18:47 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 9 May 2017 12:54:08 +0000 (13:54 +0100)
We should get either 0 or 1 here.

CID: 1373562 (Control flow issues)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
src/intel/common/gen_decoder.c

index 15bba3274ed97e10226219c4093a70ab2baa7119..24147340f5886c164632dd45a2a10794f059f830 100644 (file)
@@ -648,7 +648,7 @@ gen_spec_load_from_path(const struct gen_device_info *devinfo,
    do {
       buf = XML_GetBuffer(ctx.parser, XML_BUFFER_SIZE);
       len = fread(buf, 1, XML_BUFFER_SIZE, input);
-      if (len < 0) {
+      if (len == 0) {
          fprintf(stderr, "fread: %m\n");
          fclose(input);
          free(filename);