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>
This commit is contained in:
Salah Triki 2021-07-02 14:31:14 +01:00 committed by Greg Kroah-Hartman
parent 36cdc20b79
commit d1d26f40f7
1 changed files with 1 additions and 1 deletions

View File

@ -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;