Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio/pci: WARN_ON driver_override kasprintf failure

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

This is a blocking notifier callback, so errno isn't a proper return
value. Use WARN_ON to small allocation failures.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240115063434.20278-1-chentao@kylinos.cn
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Kunwu Chan and committed by
Alex Williamson
19032628 b401b621

+1
+1
drivers/vfio/pci/vfio_pci_core.c
··· 2047 2047 pci_name(pdev)); 2048 2048 pdev->driver_override = kasprintf(GFP_KERNEL, "%s", 2049 2049 vdev->vdev.ops->name); 2050 + WARN_ON(!pdev->driver_override); 2050 2051 } else if (action == BUS_NOTIFY_BOUND_DRIVER && 2051 2052 pdev->is_virtfn && physfn == vdev->pdev) { 2052 2053 struct pci_driver *drv = pci_dev_driver(pdev);