On 01/22/2017 09:47 AM, Yuanhan Liu wrote:
The vtpci_ops assignment needs the 'hw->port_id' as an input parameter.
That said, we should set 'hw->port_id' firstly, then do the vtpci_ops
assignment, while the code does reversely. That would result to a crash
when more than one virtio devices are used, because we keep assigning
proper vtpci_ops to virtio_hw_internal[0]->vtpci_ops, leaving the pointer
for other ports being NULL.
Reverse the order fixes this issue.
Fixes: 9470427c88e1 ("net/virtio: do not store PCI device pointer at shared
memory")
Cc: [email protected]
Reported-by: Lei Yao <[email protected]>
Signed-off-by: Yuanhan Liu <[email protected]>
---
drivers/net/virtio/virtio_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Maxime Coquelin <[email protected]>
Thanks,
Maxime