Commit 6eed261f authored by Kees Cook's avatar Kees Cook

pstore/blk: Improve failure reporting

There was no feedback on bad registration attempts. Add details on the
failure cause.

Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent d07f6ca9
...@@ -114,8 +114,22 @@ static int __register_pstore_device(struct pstore_device_info *dev) ...@@ -114,8 +114,22 @@ static int __register_pstore_device(struct pstore_device_info *dev)
lockdep_assert_held(&pstore_blk_lock); lockdep_assert_held(&pstore_blk_lock);
if (!dev || !dev->total_size || !dev->read || !dev->write) if (!dev) {
pr_err("NULL device info\n");
return -EINVAL; return -EINVAL;
}
if (!dev->total_size) {
pr_err("zero sized device\n");
return -EINVAL;
}
if (!dev->read) {
pr_err("no read handler for device\n");
return -EINVAL;
}
if (!dev->write) {
pr_err("no write handler for device\n");
return -EINVAL;
}
/* someone already registered before */ /* someone already registered before */
if (pstore_zone_info) if (pstore_zone_info)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment