Re: [Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-18 Thread Bandan Das
Peter Maydell writes: ... >> +} else { >> +usb_mtp_queue_result(s, RES_STORE_FULL, d->trans, >> + 0, 0, 0, 0); >> +} > > Presumably one of these should be RES_OK of some kind ? > Ah, yes, that's a typo. >

Re: [Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-18 Thread Peter Maydell
On Fri, 15 Mar 2019 at 15:49, Bandan Das wrote: > usb_mtp_write_metadata() handles the sendobjectinfo phase where the > initiator sends the metadata associated with the incoming object. > For a file, the name and the size is sent and once the responder sends > back OK, the initiator starts the sen

Re: [Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-15 Thread Bandan Das
Peter Maydell writes: > On Fri, 8 Mar 2019 at 19:39, Bandan Das wrote: >> >> Peter Maydell writes: >> > But the two places in usb_mtp_get_data() that call >> > usb_mtp_write_metadata() still don't check its return >> > value: don't they need to handle failure too? >> > >> I believe this is ok b

Re: [Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-14 Thread Peter Maydell
On Fri, 8 Mar 2019 at 19:39, Bandan Das wrote: > > Peter Maydell writes: > > But the two places in usb_mtp_get_data() that call > > usb_mtp_write_metadata() still don't check its return > > value: don't they need to handle failure too? > > > I believe this is ok because: > The return value of usb

Re: [Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-08 Thread Bandan Das
Peter Maydell writes: > On Thu, 7 Mar 2019 at 09:58, Gerd Hoffmann wrote: >> >> From: Bandan Das >> >> During a write, free up the "path" before getting more data. >> Also, while we at it, remove the confusing usage of d->fd for >> storing mkdir status >> >> Spotted by Coverity: CID 1398642 >>

Re: [Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-08 Thread Peter Maydell
On Thu, 7 Mar 2019 at 09:58, Gerd Hoffmann wrote: > > From: Bandan Das > > During a write, free up the "path" before getting more data. > Also, while we at it, remove the confusing usage of d->fd for > storing mkdir status > > Spotted by Coverity: CID 1398642 > > Signed-off-by: Bandan Das > Mess

[Qemu-devel] [PULL 2/4] usb-mtp: fix some usb_mtp_write_data return paths

2019-03-07 Thread Gerd Hoffmann
From: Bandan Das During a write, free up the "path" before getting more data. Also, while we at it, remove the confusing usage of d->fd for storing mkdir status Spotted by Coverity: CID 1398642 Signed-off-by: Bandan Das Message-id: 20190306210409.14842-3-...@redhat.com Signed-off-by: Gerd Hoff