diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/eth1394.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 1c26322c25af..bd67c862099e 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -1667,17 +1667,26 @@ static struct ethtool_ops ethtool_ops = { | |||
1667 | .get_drvinfo = ether1394_get_drvinfo | 1667 | .get_drvinfo = ether1394_get_drvinfo |
1668 | }; | 1668 | }; |
1669 | 1669 | ||
1670 | static int __init ether1394_init_module (void) | 1670 | static int __init ether1394_init_module(void) |
1671 | { | 1671 | { |
1672 | int err; | ||
1673 | |||
1672 | packet_task_cache = kmem_cache_create("packet_task", | 1674 | packet_task_cache = kmem_cache_create("packet_task", |
1673 | sizeof(struct packet_task), | 1675 | sizeof(struct packet_task), |
1674 | 0, 0, NULL, NULL); | 1676 | 0, 0, NULL, NULL); |
1677 | if (!packet_task_cache) | ||
1678 | return -ENOMEM; | ||
1675 | 1679 | ||
1676 | hpsb_register_highlevel(ð1394_highlevel); | 1680 | hpsb_register_highlevel(ð1394_highlevel); |
1677 | return hpsb_register_protocol(ð1394_proto_driver); | 1681 | err = hpsb_register_protocol(ð1394_proto_driver); |
1682 | if (err) { | ||
1683 | hpsb_unregister_highlevel(ð1394_highlevel); | ||
1684 | kmem_cache_destroy(packet_task_cache); | ||
1685 | } | ||
1686 | return err; | ||
1678 | } | 1687 | } |
1679 | 1688 | ||
1680 | static void __exit ether1394_exit_module (void) | 1689 | static void __exit ether1394_exit_module(void) |
1681 | { | 1690 | { |
1682 | hpsb_unregister_protocol(ð1394_proto_driver); | 1691 | hpsb_unregister_protocol(ð1394_proto_driver); |
1683 | hpsb_unregister_highlevel(ð1394_highlevel); | 1692 | hpsb_unregister_highlevel(ð1394_highlevel); |