Skip to content

Commit

Permalink
staging: ft1000: remove assigments of ret and initialise it in beginning
Browse files Browse the repository at this point in the history
as ret is every time assigned to EINVAL in fail cases, initialise it at
the beginning.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Devendra Naga authored and Greg Kroah-Hartman committed Nov 27, 2012
1 parent 64bce09 commit f884c19
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,14 @@ int ft1000_init_proc(struct net_device *dev)
{
struct ft1000_info *info;
struct proc_dir_entry *ft1000_proc_file;
int ret = 0;
int ret = -EINVAL;

info = netdev_priv(dev);

info->ft1000_proc_dir = proc_mkdir(FT1000_PROC_DIR, FTNET_PROC);
if (info->ft1000_proc_dir == NULL) {
printk(KERN_WARNING "Unable to create %s dir.\n",
FT1000_PROC_DIR);
ret = -EINVAL;
goto fail;
}

Expand All @@ -223,7 +222,6 @@ int ft1000_init_proc(struct net_device *dev)

if (ft1000_proc_file == NULL) {
printk(KERN_WARNING "Unable to create /proc entry.\n");
ret = -EINVAL;
goto fail_entry;
}

Expand Down

0 comments on commit f884c19

Please sign in to comment.