IB/ipath: Check return value of lookup_one_len
This fixes kernel.org bug 8003. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
committed by
Roland Dreier
parent
e07832b662
commit
fae8773b73
@@ -451,12 +451,18 @@ bail:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void remove_file(struct dentry *parent, char *name)
|
static int remove_file(struct dentry *parent, char *name)
|
||||||
{
|
{
|
||||||
struct dentry *tmp;
|
struct dentry *tmp;
|
||||||
|
int ret;
|
||||||
|
|
||||||
tmp = lookup_one_len(name, parent, strlen(name));
|
tmp = lookup_one_len(name, parent, strlen(name));
|
||||||
|
|
||||||
|
if (IS_ERR(tmp)) {
|
||||||
|
ret = PTR_ERR(tmp);
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock(&dcache_lock);
|
spin_lock(&dcache_lock);
|
||||||
spin_lock(&tmp->d_lock);
|
spin_lock(&tmp->d_lock);
|
||||||
if (!(d_unhashed(tmp) && tmp->d_inode)) {
|
if (!(d_unhashed(tmp) && tmp->d_inode)) {
|
||||||
@@ -469,6 +475,14 @@ static void remove_file(struct dentry *parent, char *name)
|
|||||||
spin_unlock(&tmp->d_lock);
|
spin_unlock(&tmp->d_lock);
|
||||||
spin_unlock(&dcache_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,
|
static int remove_device_files(struct super_block *sb,
|
||||||
|
Reference in New Issue
Block a user