summaryrefslogtreecommitdiff
path: root/drivers/dio
diff options
context:
space:
mode:
authorSalah Triki <salah.triki@gmail.com>2021-07-02 14:31:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 15:53:24 +0200
commitd1d26f40f71c6eabeb2083e2a18d2e55e9a71336 (patch)
tree2e019518b950aa9868b7672d7dbd1d3f3e62fff6 /drivers/dio
parent36cdc20b79ef8841d38217ea8ba837a7dbfbe852 (diff)
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 <salah.triki@gmail.com> Link: https://lore.kernel.org/r/20210702133114.GA314157@pc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dio')
-rw-r--r--drivers/dio/dio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c
index 193b40e7aec0..4c06c93c93d3 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;