Thread (13 messages) flat view 13 messages, 4 authors, 4d ago

Re: [RESEND PATCH v2 3/4] nvme: add debugfs helpers for NVMe drivers

From: Nilay Shroff <hidden>
Date: 2026-08-01 13:48:18
Also in: linux-nvme

On 7/31/26 1:44 PM, Maurizio Lombardi wrote:
On Fri Jul 31, 2026 at 9:39 AM CEST, Nilay Shroff wrote:
quoted
+static int nvme_debugfs_open(struct inode *inode, struct file *file)
+{
+	void *data = inode->i_private;
+	struct nvme_debugfs_attr *attr = debugfs_get_aux(file);
+	struct nvme_debugfs_ctx *ctx;
+	struct seq_file *m;
+	int ret;
+
+	if (attr->get && !attr->get(data))
+		return -ENODEV;
+
+	ctx = kzalloc_obj(*ctx);
+	if (WARN_ON_ONCE(!ctx)) {
+		ret = -ENOMEM;
+		goto out;
+	}
Just a nit, I don't think that raising a warning just because
kzalloc() returned NULL is a good idea as failures can naturally
occur under OOM conditions and aren't bugs.
Alright, I'll change it to just return -ENOMEM without producing
a warning, in case kzalloc fails.

Thanks,
--Nilay
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help