mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
isdn: mISDN: netjet: fix wrong check of device registration
The class is set in mISDN_register_device(), but if device_add() returns
error, it will lead to delete a device without added, fix this by using
device_is_registered() to check if the device is registered.
Fixes: a900845e56
("mISDN: Add support for Traverse Technologies NETJet PCI cards")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e7d1d4d9ac
commit
bf00f54260
@ -956,7 +956,7 @@ nj_release(struct tiger_hw *card)
|
||||
}
|
||||
if (card->irq > 0)
|
||||
free_irq(card->irq, card);
|
||||
if (card->isac.dch.dev.dev.class)
|
||||
if (device_is_registered(&card->isac.dch.dev.dev))
|
||||
mISDN_unregister_device(&card->isac.dch.dev);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user