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

Commit 69555af2 authored by Wei Yongjun's avatar Wei Yongjun Committed by Jens Axboe
Browse files

nvmet: fix return value check in nvmet_subsys_alloc()



In case of error, the function kstrndup() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: default avatarJay Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent e76debd9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -895,7 +895,7 @@ struct nvmet_subsys *nvmet_subsys_alloc(const char *subsysnqn,
	subsys->type = type;
	subsys->subsysnqn = kstrndup(subsysnqn, NVMF_NQN_SIZE,
			GFP_KERNEL);
	if (IS_ERR(subsys->subsysnqn)) {
	if (!subsys->subsysnqn) {
		kfree(subsys);
		return NULL;
	}