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