Fix errors found by Coverity Static Analysis.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2012-10-18 16:28:56 +02:00 committed by Richard Cochran
parent e3a9535dff
commit 7894339cdd
3 changed files with 5 additions and 1 deletions

View File

@ -401,7 +401,7 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count,
enum timestamp_type timestamping, struct defaultDS *ds, enum timestamp_type timestamping, struct defaultDS *ds,
enum servo_type servo) enum servo_type servo)
{ {
int i, fadj = 0, max_adj, sw_ts = timestamping == TS_SOFTWARE ? 1 : 0; int i, fadj = 0, max_adj = 0.0, sw_ts = timestamping == TS_SOFTWARE ? 1 : 0;
struct clock *c = &the_clock; struct clock *c = &the_clock;
char phc[32]; char phc[32];
struct interface udsif; struct interface udsif;

View File

@ -341,6 +341,9 @@ int config_read(char *name, struct config *cfg)
continue; continue;
} }
current_port = config_create_interface(port, cfg); current_port = config_create_interface(port, cfg);
if (current_port < 0) {
return -1;
}
} }
continue; continue;
} }

1
port.c
View File

@ -1678,6 +1678,7 @@ struct port *port_open(int phc_index,
pr_err("port %d: PHC device mismatch", number); pr_err("port %d: PHC device mismatch", number);
pr_err("port %d: /dev/ptp%d requested, but /dev/ptp%d attached", pr_err("port %d: /dev/ptp%d requested, but /dev/ptp%d attached",
number, phc_index, checked_phc_index); number, phc_index, checked_phc_index);
free(p);
return NULL; return NULL;
} }