]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/gdm72xx/sdio_boot.c
slightly reduce lossage in gdm72xx
[~andy/linux] / drivers / staging / gdm72xx / sdio_boot.c
index 6ff4dc372522b88a2890742e2f2682afd044d40a..5d484793c2e77f2af373f763e235b8748b39a1bc 100644 (file)
@@ -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;
 }