You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
libceph: check kstrndup() return value
Should check result of kstrndup() in case of memory allocation failure. Signed-off-by: Chengguang Xu <cgxu519@icloud.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
committed by
Ilya Dryomov
parent
e30ee58121
commit
affff07739
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user