mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
9p: use g_new(T, n) instead of g_malloc(sizeof(T) * n)
Because it is a recommended coding practice (see HACKING). Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
parent
bb9bf94b3e
commit
1923923bfa
1 changed files with 2 additions and 2 deletions
|
@ -1331,8 +1331,8 @@ static void coroutine_fn v9fs_walk(void *opaque)
|
||||||
trace_v9fs_walk(pdu->tag, pdu->id, fid, newfid, nwnames);
|
trace_v9fs_walk(pdu->tag, pdu->id, fid, newfid, nwnames);
|
||||||
|
|
||||||
if (nwnames && nwnames <= P9_MAXWELEM) {
|
if (nwnames && nwnames <= P9_MAXWELEM) {
|
||||||
wnames = g_malloc0(sizeof(wnames[0]) * nwnames);
|
wnames = g_new0(V9fsString, nwnames);
|
||||||
qids = g_malloc0(sizeof(qids[0]) * nwnames);
|
qids = g_new0(V9fsQID, nwnames);
|
||||||
for (i = 0; i < nwnames; i++) {
|
for (i = 0; i < nwnames; i++) {
|
||||||
err = pdu_unmarshal(pdu, offset, "s", &wnames[i]);
|
err = pdu_unmarshal(pdu, offset, "s", &wnames[i]);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue