Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2174f6df authored by Kees Cook's avatar Kees Cook Committed by Tony Luck
Browse files

pstore: gracefully handle NULL pstore_info functions



If a pstore backend doesn't want to support various portions of the
pstore interface, it can just leave those functions NULL instead of
creating no-op stubs.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 3d6d8d20
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
{
	struct pstore_private *p = dentry->d_inode->i_private;

	if (p->psi->erase)
		p->psi->erase(p->type, p->id, p->psi);

	return simple_unlink(dir, dentry);
+3 −3
Original line number Diff line number Diff line
@@ -207,8 +207,7 @@ void pstore_get_records(int quiet)
		return;

	mutex_lock(&psi->read_mutex);
	rc = psi->open(psi);
	if (rc)
	if (psi->open && psi->open(psi))
		goto out;

	while ((size = psi->read(&id, &type, &time, &buf, psi)) > 0) {
@@ -219,6 +218,7 @@ void pstore_get_records(int quiet)
		if (rc && (rc != -EEXIST || !quiet))
			failed++;
	}
	if (psi->close)
		psi->close(psi);
out:
	mutex_unlock(&psi->read_mutex);