summaryrefslogtreecommitdiffstats
path: root/fs/pstore/inode.c
diff options
context:
space:
mode:
authorKees Cook2011-11-18 22:49:00 +0100
committerTony Luck2011-11-18 22:49:00 +0100
commit2174f6df7891fa331800beb72634c969f017900b (patch)
treef9253298863844903b0ed76c7e9ae1f663b1a9d3 /fs/pstore/inode.c
parentpstore: pass reason to backend write callback (diff)
downloadkernel-qcow2-linux-2174f6df7891fa331800beb72634c969f017900b.tar.gz
kernel-qcow2-linux-2174f6df7891fa331800beb72634c969f017900b.tar.xz
kernel-qcow2-linux-2174f6df7891fa331800beb72634c969f017900b.zip
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: Kees Cook <keescook@chromium.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore/inode.c')
-rw-r--r--fs/pstore/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 379a02dc1217..b3b426edb2fd 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -80,7 +80,8 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
{
struct pstore_private *p = dentry->d_inode->i_private;
- p->psi->erase(p->type, p->id, p->psi);
+ if (p->psi->erase)
+ p->psi->erase(p->type, p->id, p->psi);
return simple_unlink(dir, dentry);
}