mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-23 21:26:58 +00:00
emmc: add check "name" sysattr is not NULL
At this point it has to be present, but better have the check for
correctness sake.
Follow up of
64fa633e30
Change-Id: I51b5995e25dc4dc4ec63b90af271cd90650d184d
This commit is contained in:
parent
64fa633e30
commit
1ca9c92919
@ -178,6 +178,14 @@ fu_emmc_device_probe (FuDevice *device, GError **error)
|
||||
|
||||
/* name */
|
||||
tmp = g_udev_device_get_sysfs_attr (udev_parent, "name");
|
||||
if (tmp == NULL) {
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"%s does not have 'name' sysattr",
|
||||
fu_device_get_name (device));
|
||||
return FALSE;
|
||||
}
|
||||
fu_device_set_name (device, tmp);
|
||||
name_only = g_strdup_printf ("EMMC\\%s", fu_device_get_name (device));
|
||||
fu_device_add_instance_id (device, name_only);
|
||||
|
Loading…
Reference in New Issue
Block a user