Commit c96db155 authored by Andrew Donnellan's avatar Andrew Donnellan Committed by Michael Ellerman
Browse files

powerpc/secvar: Don't print error on ENOENT when reading variables



If attempting to read the size or data attributes of a  non-existent
variable (which will be possible after a later patch to expose the PLPKS
via the secvar interface), don't spam the kernel log with error messages.
Only print errors for return codes that aren't ENOENT.

Reported-by: default avatarSudhakar Kuppusamy <sudhakar@linux.ibm.com>
Signed-off-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230210080401.345462-14-ajd@linux.ibm.com
parent 6d64c497
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -43,8 +43,8 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr,

	rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize);
	if (rc) {
		pr_err("Error retrieving %s variable size %d\n", kobj->name,
		       rc);
		if (rc != -ENOENT)
			pr_err("Error retrieving %s variable size %d\n", kobj->name, rc);
		return rc;
	}

@@ -61,6 +61,7 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj,

	rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize);
	if (rc) {
		if (rc != -ENOENT)
			pr_err("Error getting %s variable size %d\n", kobj->name, rc);
		return rc;
	}