Skip to content

Commit

Permalink
pcmcia: handle error in serial_cs config calls
Browse files Browse the repository at this point in the history
Do not ignore the error returned by simple_config() / multi_config().

CC: linux-serial@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Feb 17, 2010
1 parent 7ab2485 commit a78621b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/serial/serial_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,11 @@ static int serial_config(struct pcmcia_device * link)
info->multi = info->quirk->multi;

if (info->multi > 1)
multi_config(link);
i = multi_config(link);
else
simple_config(link);
i = simple_config(link);

if (info->ndev == 0)
if (i || info->ndev == 0)
goto failed;

/*
Expand All @@ -714,6 +714,7 @@ static int serial_config(struct pcmcia_device * link)
return 0;

failed:
dev_warn(&link->dev, "serial_cs: failed to initialize\n");
serial_remove(link);
return -ENODEV;
}
Expand Down

0 comments on commit a78621b

Please sign in to comment.