diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-10-31 20:13:41 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-10 17:57:51 +0100 |
commit | 3d74329d8cff9d944aa999a9a642c713ae51b036 (patch) | |
tree | a66859d59f11c9c60ccf04f1632dd6a23992eba7 /drivers/isdn | |
parent | 2ff6b669523d3b3d253a044fa9636a67d0694995 (diff) | |
download | linux-stable-3d74329d8cff9d944aa999a9a642c713ae51b036.tar.gz linux-stable-3d74329d8cff9d944aa999a9a642c713ae51b036.tar.bz2 linux-stable-3d74329d8cff9d944aa999a9a642c713ae51b036.zip |
isdn: mISDN: netjet: fix wrong check of device registration
[ Upstream commit bf00f5426074249058a106a6edbb89e4b25a4d79 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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 8299defff55a..6d818d5d1377 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++) { |