Skip to contentSkip to conversation

Fix NULL derefence in nvme_ctrl_fast_io_fail_tmo_show/store

PATCH Applied Gopal Tiwari 4 participants 4 messages Apr 14, 2021 – Apr 15, 2021 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix NULL derefence in nvme_ctrl_fast_io_fail_tmo_show/store

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

Fixes 09fbed636382 (nvme: export fast_io_fail_tmo to sysfs)
---
 drivers/nvme/host/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/core.c +2 -0
index d26eddf2bde4..dcf0228a6e09 100644
@@ -3821,6 +3821,8 @@ static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
 		return 0;
 	if (a == &dev_attr_reconnect_delay.attr && !ctrl->opts)
 		return 0;
+	if (a == &dev_attr_fast_io_fail_tmo.attr && !ctrl->opts)
+		return 0;
 
 	return a->mode;
 }
Signature · 7 lines
2.26.2


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#2 lore raw
In reply to Gopal Tiwari
Quoted 6 lines · Gopal Tiwari

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

Fixes 09fbed636382 (nvme: export fast_io_fail_tmo to sysfs)

Looks good.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme