summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-08-13 00:08:01 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-12 16:53:11 -0700
commite6d006938c9bda7ffd22af9d3e1257fd75941fb7 (patch)
treee8d5fb4d5bdbed5ebffa17f2bd51f6ac902a290c
parente941ba8650338ed78e4cfbadca4eda6668a7fe56 (diff)
cosa: missing error code on failure in probe()
If register_hdlc_device() fails, the current code returns 0 but we should return an error code instead. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/wan/cosa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 7193b7304fdd..848ea6a399f2 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -589,7 +589,8 @@ static int cosa_probe(int base, int irq, int dma)
chan->netdev->base_addr = chan->cosa->datareg;
chan->netdev->irq = chan->cosa->irq;
chan->netdev->dma = chan->cosa->dma;
- if (register_hdlc_device(chan->netdev)) {
+ err = register_hdlc_device(chan->netdev);
+ if (err) {
netdev_warn(chan->netdev,
"register_hdlc_device() failed\n");
free_netdev(chan->netdev);