On Mon, Jun 29, 2020 at 5:56 PM Michael Kelley <mikel...@microsoft.com> wrote:
> I'm not understanding the problem here.  Any VMbus driver that uses
> this requestID allocation mechanism must set newchannel->rqstor_size
> to a non-zero value.  But if a VMbus driver doesn't use the mechanism,
> then newchannel->rqstor_size will default to zero, and the mechanism
> will not be initialized for the channels used by that driver.  I think the
> cleanup of the mechanism handles the case where it wasn't ever
> initialized.  Or am I missing something?
>
> Michael

Yes, that is correct. I think the validation is necessary if there
exists an instance
where a driver call vmbus_next_request_id or vmbus_request_addr() with a rqstor
that has not been previously initialized. Currently, the rqstor
pointer is not being
validated in these 2 functions, because we assume that the driver has
initialized the
array with a non-zero value before calling next_id() or request_addr().

Andres.

Reply via email to