Browse Source

Fix some coverity.com reported errors

Serj Kalichev 10 years ago
parent
commit
b431b19b1b
3 changed files with 3 additions and 3 deletions
  1. 1 1
      irq.c
  2. 1 1
      pxm.c
  3. 1 1
      statistics.c

+ 1 - 1
irq.c

@@ -306,8 +306,8 @@ int scan_irqs(lub_list_t *irqs, lub_list_t *balance_irqs, lub_list_t *pxms)
 		iter = lub_list_iterator_next(iter);
 		if (!irq->refresh) {
 			lub_list_del(irqs, old_iter);
-			irq_free(irq);
 			printf("Remove IRQ %3d %s\n", irq->irq, STR(irq->desc));
+			irq_free(irq);
 		} else {
 			/* Drop refresh flag for next iteration */
 			irq->refresh = 0;

+ 1 - 1
pxm.c

@@ -112,7 +112,7 @@ int parse_pxm_config(const char *fname, lub_list_t *pxms, lub_list_t *numas)
 	FILE *file;
 	char *line = NULL;
 	size_t size = 0;
-	char *saveptr;
+	char *saveptr = NULL;
 	unsigned int ln = 0; /* Line number */
 	pxm_t *pxm;
 

+ 1 - 1
statistics.c

@@ -34,7 +34,7 @@ void gather_statistics(lub_list_t *cpus, lub_list_t *irqs)
 	unsigned long long l_guest_nice;
 	unsigned long long load_irq, load_all;
 	char *intr_str;
-	char *saveptr;
+	char *saveptr = NULL;
 	unsigned int inum = 0;
 
 	file = fopen("/proc/stat", "r");