diff options
| author | 2014-07-16 14:09:34 -0700 | |
|---|---|---|
| committer | 2014-07-16 14:09:34 -0700 | |
| commit | 1a98c69af1ecd97bfd1f4e4539924a9192434e36 (patch) | |
| tree | a243defcf921ea174f8e43fce11d06830a6a9c36 /drivers/tc/tc.c | |
| parent | Merge branch 'bonding-next' (diff) | |
| parent | Merge tag 'for-linus-20140716' of git://git.infradead.org/linux-mtd (diff) | |
| download | wireguard-linux-1a98c69af1ecd97bfd1f4e4539924a9192434e36.tar.xz wireguard-linux-1a98c69af1ecd97bfd1f4e4539924a9192434e36.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/tc/tc.c')
| -rw-r--r-- | drivers/tc/tc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/tc/tc.c b/drivers/tc/tc.c index a8aaf6ac2ae2..946562389ca8 100644 --- a/drivers/tc/tc.c +++ b/drivers/tc/tc.c @@ -129,7 +129,10 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus) tc_device_get_irq(tdev); - device_register(&tdev->dev); + if (device_register(&tdev->dev)) { + put_device(&tdev->dev); + goto out_err; + } list_add_tail(&tdev->node, &tbus->devices); out_err: @@ -148,7 +151,10 @@ static int __init tc_init(void) INIT_LIST_HEAD(&tc_bus.devices); dev_set_name(&tc_bus.dev, "tc"); - device_register(&tc_bus.dev); + if (device_register(&tc_bus.dev)) { + put_device(&tc_bus.dev); + return 0; + } if (tc_bus.info.slot_size) { unsigned int tc_clock = tc_get_speed(&tc_bus) / 100000; |
