diff options
author | swapnili <swapnil.ingle@nutanix.com> | 2020-11-18 09:10:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 09:10:44 +0100 |
commit | 7f3b16acc80614fa2303d89fcce34ba21a327592 (patch) | |
tree | 829b144f6921133c5aff36d8d336a4d763aaea21 /lib/cap.c | |
parent | 0eb8d4f83cfc43cd50d799e7b1bd23698ccc60aa (diff) | |
parent | 0a3cf29466b3785c12c9fbae502df5351137ec03 (diff) | |
download | libvfio-user-7f3b16acc80614fa2303d89fcce34ba21a327592.zip libvfio-user-7f3b16acc80614fa2303d89fcce34ba21a327592.tar.gz libvfio-user-7f3b16acc80614fa2303d89fcce34ba21a327592.tar.bz2 |
Merge pull request #92 from swapnili/master
Cleanup and warning fixes
Diffstat (limited to 'lib/cap.c')
-rw-r--r-- | lib/cap.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -209,6 +209,7 @@ handle_pm_write(lm_ctx_t *lm_ctx, uint8_t *cap, char *const buf, return -EINVAL; } assert(false); /* FIXME implement */ + break; case offsetof(struct pmcap, pmcs): if (count != sizeof(struct pmcs)) { return -EINVAL; @@ -413,14 +414,15 @@ caps_create(lm_ctx_t *lm_ctx, lm_cap_t **lm_caps, int nr_caps) struct caps *caps; if (nr_caps <= 0 || nr_caps >= LM_MAX_CAPS) { - err = EINVAL; - goto out; + errno = EINVAL; + return NULL; } assert(lm_caps != NULL); caps = calloc(1, sizeof *caps); if (caps == NULL) { + err = ENOMEM; goto out; } @@ -466,6 +468,7 @@ out: if (err) { free(caps); caps = NULL; + errno = err; } return caps; } |