Commit 99da1a8a6dc549630733e1cc246265d282fc214e

Authored by Ingo Molnar
Committed by David S. Miller
1 parent a098397d56

depca: fix warning in drivers/net/depca.c

fix warning:

  drivers/net/depca.c: In function ‘depca_eisa_probe’:
  drivers/net/depca.c:1564: warning: ‘mem_start’ may be used uninitialized in this function

this seems to be a real bug - depca_eisa_probe() does not check
for failure. Add it, symmetric to depca_isa_probe().

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff

... ... @@ -1556,6 +1556,7 @@
1556 1556 #ifdef CONFIG_EISA
1557 1557 static int __init depca_eisa_probe (struct device *device)
1558 1558 {
  1559 + enum depca_type adapter = unknown;
1559 1560 struct eisa_device *edev;
1560 1561 struct net_device *dev;
1561 1562 struct depca_private *lp;
... ... @@ -1574,7 +1575,11 @@
1574 1575 * the EISA configuration structures (yet... :-), just rely on
1575 1576 * the ISA probing to sort it out... */
1576 1577  
1577   - depca_shmem_probe (&mem_start);
  1578 + adapter = depca_shmem_probe (&mem_start);
  1579 + if (adapter == unknown) {
  1580 + status = -ENODEV;
  1581 + goto out_free;
  1582 + }
1578 1583  
1579 1584 dev->base_addr = ioaddr;
1580 1585 dev->irq = irq;