mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 14:36:33 +00:00
trivial: Fix a critical warning when using old kernel versions
This commit is contained in:
parent
d25d4f124e
commit
ef04d0578f
@ -131,8 +131,9 @@ fu_i2c_device_probe(FuDevice *device, GError **error)
|
|||||||
|
|
||||||
/* get bus number out of sysfs path */
|
/* get bus number out of sysfs path */
|
||||||
udev_parent = g_udev_device_get_parent(udev_device);
|
udev_parent = g_udev_device_get_parent(udev_device);
|
||||||
|
if (udev_parent != NULL)
|
||||||
devname = g_path_get_basename(g_udev_device_get_sysfs_path(udev_parent));
|
devname = g_path_get_basename(g_udev_device_get_sysfs_path(udev_parent));
|
||||||
if (g_str_has_prefix(devname, "i2c-")) {
|
if (devname != NULL && g_str_has_prefix(devname, "i2c-")) {
|
||||||
guint64 tmp64 = 0;
|
guint64 tmp64 = 0;
|
||||||
g_autoptr(GError) error_local = NULL;
|
g_autoptr(GError) error_local = NULL;
|
||||||
if (!fu_strtoull(devname + 4, &tmp64, 0, G_MAXUINT, &error_local)) {
|
if (!fu_strtoull(devname + 4, &tmp64, 0, G_MAXUINT, &error_local)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user