diff options
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 5adc662c4bfb..ff7eb9116b6a 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -493,13 +493,14 @@ static int pcmcia_get_versmac(struct pcmcia_device *p_dev, | |||
493 | { | 493 | { |
494 | struct net_device *dev = priv; | 494 | struct net_device *dev = priv; |
495 | cisparse_t parse; | 495 | cisparse_t parse; |
496 | u8 *buf; | ||
496 | 497 | ||
497 | if (pcmcia_parse_tuple(tuple, &parse)) | 498 | if (pcmcia_parse_tuple(tuple, &parse)) |
498 | return -EINVAL; | 499 | return -EINVAL; |
499 | 500 | ||
500 | if ((parse.version_1.ns > 3) && | 501 | buf = parse.version_1.str + parse.version_1.ofs[3]; |
501 | (cvt_ascii_address(dev, | 502 | |
502 | (parse.version_1.str + parse.version_1.ofs[3])))) | 503 | if ((parse.version_1.ns > 3) && (cvt_ascii_address(dev, buf) == 0)) |
503 | return 0; | 504 | return 0; |
504 | 505 | ||
505 | return -EINVAL; | 506 | return -EINVAL; |
@@ -528,7 +529,7 @@ static int mhz_setup(struct pcmcia_device *link) | |||
528 | len = pcmcia_get_tuple(link, 0x81, &buf); | 529 | len = pcmcia_get_tuple(link, 0x81, &buf); |
529 | if (buf && len >= 13) { | 530 | if (buf && len >= 13) { |
530 | buf[12] = '\0'; | 531 | buf[12] = '\0'; |
531 | if (cvt_ascii_address(dev, buf)) | 532 | if (cvt_ascii_address(dev, buf) == 0) |
532 | rc = 0; | 533 | rc = 0; |
533 | } | 534 | } |
534 | kfree(buf); | 535 | kfree(buf); |
@@ -910,7 +911,7 @@ static int smc91c92_config(struct pcmcia_device *link) | |||
910 | 911 | ||
911 | if (i != 0) { | 912 | if (i != 0) { |
912 | printk(KERN_NOTICE "smc91c92_cs: Unable to find hardware address.\n"); | 913 | printk(KERN_NOTICE "smc91c92_cs: Unable to find hardware address.\n"); |
913 | goto config_undo; | 914 | goto config_failed; |
914 | } | 915 | } |
915 | 916 | ||
916 | smc->duplex = 0; | 917 | smc->duplex = 0; |
@@ -998,6 +999,7 @@ config_undo: | |||
998 | unregister_netdev(dev); | 999 | unregister_netdev(dev); |
999 | config_failed: | 1000 | config_failed: |
1000 | smc91c92_release(link); | 1001 | smc91c92_release(link); |
1002 | free_netdev(dev); | ||
1001 | return -ENODEV; | 1003 | return -ENODEV; |
1002 | } /* smc91c92_config */ | 1004 | } /* smc91c92_config */ |
1003 | 1005 | ||