linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Gopal Tiwari <gtiwari@redhat.com>
To: linux-nvme@lists.infradead.org, kbusch@kernel.org
Cc: gtiwari@redhat.com
Subject: [PATCH] Fix NULL derefence in nvme_ctrl_fast_io_fail_tmo_show/store
Date: Wed, 14 Apr 2021 14:16:45 +0530	[thread overview]
Message-ID: <20210414084645.638150-1-gtiwari@redhat.com> (raw)

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)

Signed-off-by: Gopal Tiwari <gtiwari@redhat.com>
---
 drivers/nvme/host/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d26eddf2bde4..dcf0228a6e09 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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;
 }
-- 
2.26.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

             reply	other threads:[~2021-04-14  8:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  8:46 Gopal Tiwari [this message]
2021-04-14 14:13 ` [PATCH] Fix NULL derefence in nvme_ctrl_fast_io_fail_tmo_show/store Keith Busch
2021-04-14 18:22 ` Chaitanya Kulkarni
2021-04-15  7:57 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210414084645.638150-1-gtiwari@redhat.com \
    --to=gtiwari@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).