[PATCH] node_device_udev: add error reporting to udevProcessCCWGroup

Add reporting an internal error when the string to type conversion of devtype fails as this indicates a serious problem since devtype was used to get into this method during the udev event handling. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/node_device/node_device_udev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 7b4ff80f8f..344b39e97a 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1415,8 +1415,12 @@ udevProcessCCWGroup(struct udev_device *device, udevGenerateDeviceName(device, def, NULL); - if ((tmp = virNodeDevCCWGroupCapTypeFromString(devtype)) < 0) + if ((tmp = virNodeDevCCWGroupCapTypeFromString(devtype)) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("failed to find a supported CCW group capability type '%1$s'"), + devtype); return -1; + } data->ccwgroup_dev.type = tmp; -- 2.47.0

On 2/6/25 17:27, Boris Fiuczynski wrote:
Add reporting an internal error when the string to type conversion of devtype fails as this indicates a serious problem since devtype was used to get into this method during the udev event handling.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/node_device/node_device_udev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (2)
-
Boris Fiuczynski
-
Michal Prívozník