summaryrefslogtreecommitdiff
path: root/drivers/staging/gdm72xx/sdio_boot.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-07-22 21:09:14 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-29 21:24:20 +0400
commit09fada5b5f1f56502bb14f36a69a2c31cea262be (patch)
treeb7c9e5bf2837d7758c61c1c446b58e7028310b30 /drivers/staging/gdm72xx/sdio_boot.c
parent32aecdd36528449cec34e6e63dcd5f0221ca7b43 (diff)
slightly reduce lossage in gdm72xx
* filp_close() needs non-NULL second argument only if it'd been in descriptor table * opened files have non-NULL dentries, TYVM * ... and those dentries are positive - it's kinda hard to open a file that doesn't exist. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging/gdm72xx/sdio_boot.c')
-rw-r--r--drivers/staging/gdm72xx/sdio_boot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/gdm72xx/sdio_boot.c b/drivers/staging/gdm72xx/sdio_boot.c
index 6ff4dc372522..5d484793c2e7 100644
--- a/drivers/staging/gdm72xx/sdio_boot.c
+++ b/drivers/staging/gdm72xx/sdio_boot.c
@@ -67,9 +67,8 @@ static int download_image(struct sdio_func *func, char *img_name)
return -ENOENT;
}
- if (filp->f_dentry)
- inode = filp->f_dentry->d_inode;
- if (!inode || !S_ISREG(inode->i_mode)) {
+ inode = filp->f_dentry->d_inode;
+ if (!S_ISREG(inode->i_mode)) {
printk(KERN_ERR "Invalid file type: %s\n", img_name);
ret = -EINVAL;
goto out;
@@ -124,7 +123,7 @@ static int download_image(struct sdio_func *func, char *img_name)
pno++;
}
out:
- filp_close(filp, current->files);
+ filp_close(filp, NULL);
return ret;
}