Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320959
b: refs/heads/master
c: 09fada5
h: refs/heads/master
i:
  320957: afdac98
  320955: 4432c26
  320951: f5acc41
  320943: 0b99678
  320927: afe7b96
  320895: d0c9961
v: v3
  • Loading branch information
Al Viro committed Jul 29, 2012
1 parent 7311ef2 commit 4e8b1e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32aecdd36528449cec34e6e63dcd5f0221ca7b43
refs/heads/master: 09fada5b5f1f56502bb14f36a69a2c31cea262be
7 changes: 3 additions & 4 deletions trunk/drivers/staging/gdm72xx/sdio_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
22 changes: 9 additions & 13 deletions trunk/drivers/staging/gdm72xx/usb_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,12 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
filp = filp_open(img_name, O_RDONLY | O_LARGEFILE, 0);
if (IS_ERR(filp)) {
printk(KERN_ERR "Can't find %s.\n", img_name);
set_fs(fs);
ret = -ENOENT;
goto restore_fs;
}

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;
Expand Down Expand Up @@ -263,7 +261,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
ret = -EINVAL;
}
out:
filp_close(filp, current->files);
filp_close(filp, NULL);

restore_fs:
set_fs(fs);
Expand Down Expand Up @@ -323,13 +321,11 @@ static int em_download_image(struct usb_device *usbdev, char *path,
goto restore_fs;
}

if (filp->f_dentry) {
inode = filp->f_dentry->d_inode;
if (!inode || !S_ISREG(inode->i_mode)) {
printk(KERN_ERR "Invalid file type: %s\n", path);
ret = -EINVAL;
goto out;
}
inode = filp->f_dentry->d_inode;
if (!S_ISREG(inode->i_mode)) {
printk(KERN_ERR "Invalid file type: %s\n", path);
ret = -EINVAL;
goto out;
}

buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL);
Expand Down Expand Up @@ -365,7 +361,7 @@ static int em_download_image(struct usb_device *usbdev, char *path,
goto out;

out:
filp_close(filp, current->files);
filp_close(filp, NULL);

restore_fs:
set_fs(fs);
Expand Down

0 comments on commit 4e8b1e8

Please sign in to comment.