diff options
-rw-r--r-- | fs/pstore/inode.c | 3 | ||||
-rw-r--r-- | fs/pstore/platform.c | 6 |
2 files changed, 5 insertions, 4 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) | |||
80 | { | 80 | { |
81 | struct pstore_private *p = dentry->d_inode->i_private; | 81 | struct pstore_private *p = dentry->d_inode->i_private; |
82 | 82 | ||
83 | p->psi->erase(p->type, p->id, p->psi); | 83 | if (p->psi->erase) |
84 | p->psi->erase(p->type, p->id, p->psi); | ||
84 | 85 | ||
85 | return simple_unlink(dir, dentry); | 86 | return simple_unlink(dir, dentry); |
86 | } | 87 | } |
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index f146d89179bf..9ec22d3b4293 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -207,8 +207,7 @@ void pstore_get_records(int quiet) | |||
207 | return; | 207 | return; |
208 | 208 | ||
209 | mutex_lock(&psi->read_mutex); | 209 | mutex_lock(&psi->read_mutex); |
210 | rc = psi->open(psi); | 210 | if (psi->open && psi->open(psi)) |
211 | if (rc) | ||
212 | goto out; | 211 | goto out; |
213 | 212 | ||
214 | while ((size = psi->read(&id, &type, &time, &buf, psi)) > 0) { | 213 | while ((size = psi->read(&id, &type, &time, &buf, psi)) > 0) { |
@@ -219,7 +218,8 @@ void pstore_get_records(int quiet) | |||
219 | if (rc && (rc != -EEXIST || !quiet)) | 218 | if (rc && (rc != -EEXIST || !quiet)) |
220 | failed++; | 219 | failed++; |
221 | } | 220 | } |
222 | psi->close(psi); | 221 | if (psi->close) |
222 | psi->close(psi); | ||
223 | out: | 223 | out: |
224 | mutex_unlock(&psi->read_mutex); | 224 | mutex_unlock(&psi->read_mutex); |
225 | 225 | ||