Skip to content

Commit

Permalink
drivers: dio: add missing iounmap() in dio_init()
Browse files Browse the repository at this point in the history
If kzalloc() fails, iounmap() need be called in error path.

Signed-off-by: Yang Yingliang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Yang Yingliang authored and gregkh committed May 19, 2022
1 parent 1061013 commit 077f5d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/dio/dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 077f5d9

Please sign in to comment.