initramfs: fix initramfs size calculation
[linux-drm-fsl-dcu.git] / scripts / kallsyms.c
index 86c3896a1e01862b222adeaac4e33bc9b8a01aad..60dd3eb9366e4c5404383285df6cee3886bfa699 100644 (file)
@@ -107,10 +107,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 
        rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
        if (rc != 3) {
-               if (rc != EOF) {
-                       /* skip line */
-                       fgets(str, 500, in);
-               }
+               if (rc != EOF && fgets(str, 500, in) == NULL)
+                       fprintf(stderr, "Read error or end of file.\n");
                return -1;
        }