Commit 077f5d90 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman

drivers: dio: add missing iounmap() in dio_init()

If kzalloc() fails, iounmap() need be called in error path.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220511064506.3398512-1-yangyingliang@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 10610130
......@@ -216,8 +216,11 @@ static int __init dio_init(void)
/* Found a board, allocate it an entry in the list */
dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL);
if (!dev)
if (!dev) {
if (scode >= DIOII_SCBASE)
iounmap(va);
return -ENOMEM;
}
dev->bus = &dio_bus;
dev->dev.parent = &dio_bus.dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment