From: Salah Triki Date: Fri, 2 Jul 2021 13:31:14 +0000 (+0100) Subject: dio: return -ENOMEM when kzalloc() fails X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d1d26f40f71c6eabeb2083e2a18d2e55e9a71336;p=linux.git dio: return -ENOMEM when kzalloc() fails Return -ENOMEM when kzalloc() fails in order to inform the caller of the failure. Signed-off-by: Salah Triki Link: https://lore.kernel.org/r/20210702133114.GA314157@pc Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c index 193b40e7aec03..4c06c93c93d32 100644 --- a/drivers/dio/dio.c +++ b/drivers/dio/dio.c @@ -219,7 +219,7 @@ 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) - return 0; + return -ENOMEM; dev->bus = &dio_bus; dev->dev.parent = &dio_bus.dev;