RE: [PATCH] Drivers: hv: vmbus: Fix variable assignments in hv_ringbuffer_read()

2020-07-26 Thread Haiyang Zhang
Andrea > Parri ; Saruhan Karademir > > Subject: Re: [PATCH] Drivers: hv: vmbus: Fix variable assignments in > hv_ringbuffer_read() > > On Fri, Jul 24, 2020 at 1:10 PM Stephen Hemminger > wrote: > > What is the rationale for this change, it may break other code. >

Re: [PATCH] Drivers: hv: vmbus: Fix variable assignments in hv_ringbuffer_read()

2020-07-24 Thread Andres Beltran
On Fri, Jul 24, 2020 at 1:10 PM Stephen Hemminger wrote: > What is the rationale for this change, it may break other code. > > A common API model in Windows world where this originated > is to have a call where caller first > makes request and then if the requested buffer is not big enough the > c

RE: [PATCH] Drivers: hv: vmbus: Fix variable assignments in hv_ringbuffer_read()

2020-07-24 Thread Haiyang Zhang
ael Kelley ; > parri.and...@gmail.com; Saruhan Karademir > Subject: Re: [PATCH] Drivers: hv: vmbus: Fix variable assignments in > hv_ringbuffer_read() > > On Fri, 24 Jul 2020 09:46:06 -0700 > "Andres Beltran" wrote: > > > Assignments to buffer_actual_len and

Re: [PATCH] Drivers: hv: vmbus: Fix variable assignments in hv_ringbuffer_read()

2020-07-24 Thread Stephen Hemminger
On Fri, 24 Jul 2020 09:46:06 -0700 "Andres Beltran" wrote: > Assignments to buffer_actual_len and requestid happen before packetlen > is checked to be within buflen. If this condition is true, > hv_ringbuffer_read() returns with these variables already set to some > value even though no data is a

[PATCH] Drivers: hv: vmbus: Fix variable assignments in hv_ringbuffer_read()

2020-07-24 Thread Andres Beltran
Assignments to buffer_actual_len and requestid happen before packetlen is checked to be within buflen. If this condition is true, hv_ringbuffer_read() returns with these variables already set to some value even though no data is actually read. This might create inconsistencies in any routine callin