提交 077f5d90 编写于 作者: Y Yang Yingliang 提交者: Greg Kroah-Hartman

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

If kzalloc() fails, iounmap() need be called in error path.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220511064506.3398512-1-yangyingliang@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 10610130
...@@ -216,8 +216,11 @@ static int __init dio_init(void) ...@@ -216,8 +216,11 @@ static int __init dio_init(void)
/* Found a board, allocate it an entry in the list */ /* Found a board, allocate it an entry in the list */
dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL); dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL);
if (!dev) if (!dev) {
if (scode >= DIOII_SCBASE)
iounmap(va);
return -ENOMEM; return -ENOMEM;
}
dev->bus = &dio_bus; dev->bus = &dio_bus;
dev->dev.parent = &dio_bus.dev; dev->dev.parent = &dio_bus.dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册