[PATCH v2 resend] bus/vdev: vdev_cleanup checks dev->device.driver
David Marchand
david.marchand at redhat.com
Thu Oct 20 13:32:09 CEST 2022
On Wed, Oct 19, 2022 at 4:14 PM Zhangfei Gao <zhangfei.gao at linaro.org> wrote:
>
> vdev_probe calls driver->probe and set dev->device.driver,
> which will be NULL if the probe fails.
>
> In vdev_cleanup, drv = container_of(dev->device.driver)
> drv will be !NULL in this case, causing drv->remove
> Segmentation fault.
>
> Fixed by checking dev->device.driver before.
>
> Log:
> $ sudo dpdk-test --vdev=crypto_uadk --log-level=6
> vdev_probe(): failed to initialize crypto_uadk device
> EAL: Bus (vdev) probe failed.
> RTE>>quit
> Segmentation fault
>
> Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown")
> Signed-off-by: Zhangfei Gao <zhangfei.gao at linaro.org>
Reviewed-by: David Marchand <david.marchand at redhat.com>
Applied, thanks.
--
David Marchand
More information about the dev
mailing list