diff --git a/lib/cfg.c b/lib/cfg.c index 519a32219..c4f3b8b95 100644 --- a/lib/cfg.c +++ b/lib/cfg.c @@ -32,7 +32,7 @@ void cfg_destroy(config_t *cfg) int cfg_parse(const char *filename, config_t *cfg, struct settings *set, struct list *nodes, struct list *paths) { - int ret; + int ret = CONFIG_FALSE; char *filename_cpy, *include_dir; config_init(cfg); diff --git a/lib/fpga/dma.c b/lib/fpga/dma.c index fad8fb4f2..dc49a1945 100644 --- a/lib/fpga/dma.c +++ b/lib/fpga/dma.c @@ -320,7 +320,7 @@ int dma_sg_read_complete(struct ip *c, char **buf, size_t *len) int ret, bdcnt; uint32_t recvlen, sr; - uintptr_t recvbuf; + uintptr_t recvbuf = NULL; if (!xdma->HasSg) return -1; diff --git a/lib/kernel/vfio.c b/lib/kernel/vfio.c index 405c81697..aee6d74f3 100644 --- a/lib/kernel/vfio.c +++ b/lib/kernel/vfio.c @@ -375,8 +375,10 @@ int vfio_pci_msi_find(struct vfio_dev *d, int nos[32]) continue; /* Find last column of line */ - while ((col = strtok(NULL, " "))) + do { last = col; + } while ((col = strtok(NULL, " "))); + ret = sscanf(last, "vfio-msi[%u](%12[0-9:])", &idx, name); if (ret == 2) { diff --git a/src/fpga-tests.c b/src/fpga-tests.c index e6c525530..0790a2607 100644 --- a/src/fpga-tests.c +++ b/src/fpga-tests.c @@ -258,7 +258,7 @@ int fpga_test_fifo(struct fpga *f) int fpga_test_dma(struct fpga *f) { - int ret; + int ret = -1; struct dma_mem mem, src, dst; list_foreach(struct ip *dma, &f->ips) { INDENT