diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-10-31 13:13:41 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-11-02 13:34:48 +0100 |
commit | bf00f5426074249058a106a6edbb89e4b25a4d79 (patch) | |
tree | ade5577bfe194ec91eec7ed829af215215240838 /drivers/isdn | |
parent | mISDN: fix possible memory leak in mISDN_register_device() (diff) | |
download | linux-bf00f5426074249058a106a6edbb89e4b25a4d79.tar.xz linux-bf00f5426074249058a106a6edbb89e4b25a4d79.zip |
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: a900845e5661 ("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>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/hardware/mISDN/netjet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index a52f275f8263..f8447135a902 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c @@ -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++) { |