Skip to contentSkip to conversation

efi: split efisubsystem from efivars

DISCUSSION Dan Carpenter 1 participant 1 message Jun 15, 2016 VFS

lore
Share & tools
lore
#0 lore raw

Hello Tom Gundersen,

The patch a9499fa7cd3f: "efi: split efisubsystem from efivars" from Feb 8, 2013, leads to the following static checker warning:

	fs/super.c:1094 mount_single()
	error: passing non negative 1 to ERR_PTR

drivers/firmware/efi/efivars.c
638 static int efivar_update_sysfs_entry(efi_char16_t *name, efi_guid_t vendor,
639 unsigned long name_size, void *data)
640 {
641 struct efivar_entry *entry = data;
642
643 if (efivar_entry_find(name, vendor, &efivar_sysfs_list, false))
644 return 0;
645
646 memcpy(entry->var.VariableName, name, name_size);
647 memcpy(&(entry->var.VendorGuid), &vendor, sizeof(efi_guid_t));
648
649 return 1;

The comments imply that this should return 0 on success and negative error codes on failure.

650 }
651

The function is called from efivar_init() as a pointer.

663 err = efivar_init(efivar_update_sysfs_entry, entry,
664 false, &efivar_sysfs_list);

The comments on efivar_init() say it should return zero on success or a negative error code.

regards,
dan carpenter