drivers: dio: add missing iounmap() in dio_init()
[linux-block.git] / drivers / dio / dio.c
index 005a82f671c375d26a9c622dd794d8cbd0bfa524..0e5a5662d5a40c21d1aa2c9e38eb200af70324e1 100644 (file)
@@ -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;