Skip to content

Commit

Permalink
cosa: missing error code on failure in probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Aug 12, 2015
1 parent e941ba8 commit e6d0069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wan/cosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e6d0069

Please sign in to comment.