diff options
author | Kees Cook <keescook@chromium.org> | 2011-11-18 16:49:00 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-11-18 16:49:00 -0500 |
commit | 2174f6df7891fa331800beb72634c969f017900b (patch) | |
tree | f9253298863844903b0ed76c7e9ae1f663b1a9d3 /fs/pstore/platform.c | |
parent | 3d6d8d20ec4fd3b256632edb373a9c504724b8a9 (diff) |
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/platform.c')
-rw-r--r-- | fs/pstore/platform.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index f146d89179b..9ec22d3b429 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 | ||