diff options
author | Wang ShaoBo <bobo.shaobowang@huawei.com> | 2022-11-10 19:38:23 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-11-14 10:43:13 +0000 |
commit | 2d25107e111a85c56f601a5470f1780ec054e6ac (patch) | |
tree | 4a2157ef3a4afbc7e85d523dda017028b3b6054d | |
parent | 8979f428a4afc215e390006e5ea19fd4e22c7ca9 (diff) | |
download | lwn-2d25107e111a85c56f601a5470f1780ec054e6ac.tar.gz lwn-2d25107e111a85c56f601a5470f1780ec054e6ac.zip |
mISDN: fix misuse of put_device() in mISDN_register_device()
We should not release reference by put_device() before calling device_initialize().
Fixes: e7d1d4d9ac0d ("mISDN: fix possible memory leak in mISDN_register_device()")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/mISDN/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c index 7ea0100f218a..90ee56d07a6e 100644 --- a/drivers/isdn/mISDN/core.c +++ b/drivers/isdn/mISDN/core.c @@ -222,7 +222,7 @@ mISDN_register_device(struct mISDNdevice *dev, err = get_free_devid(); if (err < 0) - goto error1; + return err; dev->id = err; device_initialize(&dev->dev); |