lkml.org 
[lkml]   [2007]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] IB/ipath: check return value of lookup_one_len
Date
From
This fixes kernel.org bug 8003.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>

diff -r 2a2b2b882891 -r e3e94873cfa0 drivers/infiniband/hw/ipath/ipath_fs.c
--- a/drivers/infiniband/hw/ipath/ipath_fs.c Wed Mar 21 15:16:07 2007 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c Wed Mar 21 15:16:07 2007 -0700
@@ -456,11 +456,17 @@ bail:
return ret;
}

-static void remove_file(struct dentry *parent, char *name)
+static int remove_file(struct dentry *parent, char *name)
{
struct dentry *tmp;
+ int ret;

tmp = lookup_one_len(name, parent, strlen(name));
+
+ if (IS_ERR(tmp)) {
+ ret = PTR_ERR(tmp);
+ goto bail;
+ }

spin_lock(&dcache_lock);
spin_lock(&tmp->d_lock);
@@ -474,6 +480,14 @@ static void remove_file(struct dentry *p
spin_unlock(&tmp->d_lock);
spin_unlock(&dcache_lock);
}
+
+ ret = 0;
+bail:
+ /*
+ * We don't expect clients to care about the return value, but
+ * it's there if they need it.
+ */
+ return ret;
}

static int remove_device_files(struct super_block *sb,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-03-21 23:21    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean