Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

If kzalloc() fails, iounmap() need be called in error path.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220511064506.3398512-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Yang Yingliang and committed by
Greg Kroah-Hartman
077f5d90 10610130

+4 -1
+4 -1
drivers/dio/dio.c
··· 216 216 217 217 /* Found a board, allocate it an entry in the list */ 218 218 dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL); 219 - if (!dev) 219 + if (!dev) { 220 + if (scode >= DIOII_SCBASE) 221 + iounmap(va); 220 222 return -ENOMEM; 223 + } 221 224 222 225 dev->bus = &dio_bus; 223 226 dev->dev.parent = &dio_bus.dev;