Commit b0c26a79 authored by Goldwyn Rodrigues's avatar Goldwyn Rodrigues Committed by NeilBrown

md: Return error if request_module fails and returns positive value

request_module() can return 256 (process exited) in some cases,
which is not as specified in the documentation before the
request_module() definition. Convert the error to -ENOENT.

The positive error number results in bitmap_create() returning
a value that is meant to be an error but doesn't look like one,
so it is dereferenced as a point and causes a crash.

(not needed for stable as this is "experimental" code)
Fixes: edb39c9d ("Introduce md_cluster_operations to handle cluster functions")
Signed-off-By: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
parent f7357273
...@@ -7439,7 +7439,7 @@ int md_setup_cluster(struct mddev *mddev, int nodes) ...@@ -7439,7 +7439,7 @@ int md_setup_cluster(struct mddev *mddev, int nodes)
err = request_module("md-cluster"); err = request_module("md-cluster");
if (err) { if (err) {
pr_err("md-cluster module not found.\n"); pr_err("md-cluster module not found.\n");
return err; return -ENOENT;
} }
spin_lock(&pers_lock); spin_lock(&pers_lock);
......
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