Skip to content

Commit 0975b8b

Browse files
committed
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
This pull request contains: - a patch to add a vdc->reset() handler to virtio-9p - a bunch of patches to fix various memory leaks (thanks to Li Qiang) - some code cleanups for 9pfs # gpg: Signature made Mon 17 Oct 2016 16:01:46 BST # gpg: using DSA key 0x02FC3AEB0101DBC2 # gpg: Good signature from "Greg Kurz <[email protected]>" # gpg: aka "Greg Kurz <[email protected]>" # gpg: aka "Greg Kurz <[email protected]>" # gpg: aka "Greg Kurz <[email protected]>" # gpg: aka "Gregory Kurz (Groug) <[email protected]>" # gpg: aka "Gregory Kurz (Cimai Technology) <[email protected]>" # gpg: aka "Gregory Kurz (Meiosys Technology) <[email protected]>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894 DBA2 02FC 3AEB 0101 DBC2 * remotes/gkurz/tags/for-upstream: 9pfs: fix memory leak in v9fs_write 9pfs: fix memory leak in v9fs_link 9pfs: fix memory leak in v9fs_xattrcreate 9pfs: fix information leak in xattr read virtio-9p: add reset handler 9pfs: only free completed request if not flushed 9pfs: drop useless check in pdu_free() 9pfs: use coroutine_fn annotation in hw/9pfs/9p.[ch] 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch] 9pfs: fsdev: drop useless extern annotation for functions 9pfs: fix potential host memory leak in v9fs_read 9pfs: allocate space for guest originated empty strings Signed-off-by: Peter Maydell <[email protected]>
2 parents 7bf59df + fdfcc9a commit 0975b8b

File tree

12 files changed

+245
-190
lines changed

12 files changed

+245
-190
lines changed

fsdev/9p-iov-marshal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ssize_t v9fs_iov_vunmarshal(struct iovec *out_sg, int out_num, size_t offset,
125125
str->data = g_malloc(str->size + 1);
126126
copied = v9fs_unpack(str->data, out_sg, out_num, offset,
127127
str->size);
128-
if (copied > 0) {
128+
if (copied >= 0) {
129129
str->data[str->size] = 0;
130130
} else {
131131
v9fs_string_free(str);

fsdev/9p-marshal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ static inline void v9fs_string_init(V9fsString *str)
7676
str->data = NULL;
7777
str->size = 0;
7878
}
79-
extern void v9fs_string_free(V9fsString *str);
80-
extern void v9fs_string_sprintf(V9fsString *str, const char *fmt, ...);
81-
extern void v9fs_string_copy(V9fsString *lhs, V9fsString *rhs);
79+
void v9fs_string_free(V9fsString *str);
80+
void v9fs_string_sprintf(V9fsString *str, const char *fmt, ...);
81+
void v9fs_string_copy(V9fsString *lhs, V9fsString *rhs);
8282

8383
#endif

hw/9pfs/9p-synth.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ typedef struct V9fsSynthOpenState {
4343
struct dirent dent;
4444
} V9fsSynthOpenState;
4545

46-
extern int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,
47-
const char *name, V9fsSynthNode **result);
48-
extern int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
49-
const char *name, v9fs_synth_read read,
50-
v9fs_synth_write write, void *arg);
46+
int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode,
47+
const char *name, V9fsSynthNode **result);
48+
int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
49+
const char *name, v9fs_synth_read read,
50+
v9fs_synth_write write, void *arg);
5151

5252
#endif

0 commit comments

Comments
 (0)