Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit affff077 authored by Chengguang Xu's avatar Chengguang Xu Committed by Ilya Dryomov
Browse files

libceph: check kstrndup() return value



Should check result of kstrndup() in case of memory allocation failure.

Signed-off-by: default avatarChengguang Xu <cgxu519@icloud.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent e30ee581
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -421,6 +421,10 @@ ceph_parse_options(char *options, const char *dev_name,
			opt->name = kstrndup(argstr[0].from,
					      argstr[0].to-argstr[0].from,
					      GFP_KERNEL);
			if (!opt->name) {
				err = -ENOMEM;
				goto out;
			}
			break;
		case Opt_secret:
		        opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);