提交 941b7dce 编写于 作者: G Gopal Tiwari 提交者: Yang Yingliang

nvme: fix NULL derefence in nvme_ctrl_fast_io_fail_tmo_show/store

mainline inclusion
from mainline-v5.13-rc1
commit d6609084
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I4JFPM?from=project-issue

-------------------------------------------------

Adding entry for dev_attr_fast_io_fail_tmo to avoid the kernel crash
while reading and writing the fast_io_fail_tmo.

Fixes: 09fbed63 (nvme: export fast_io_fail_tmo to sysfs)
Signed-off-by: NGopal Tiwari <gtiwari@redhat.com>
Reviewed-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: Njiangtao <jiangtao62@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8cacb011
......@@ -3157,6 +3157,8 @@ static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
return 0;
if (a == &dev_attr_address.attr && !ctrl->ops->get_address)
return 0;
if (a == &dev_attr_fast_io_fail_tmo.attr && !ctrl->opts)
return 0;
return a->mode;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册