Commit d1d26f40 authored by Salah Triki's avatar Salah Triki Committed by Greg Kroah-Hartman
Browse files

dio: return -ENOMEM when kzalloc() fails



Return -ENOMEM when kzalloc() fails in order to inform the caller of the
failure.

Signed-off-by: default avatarSalah Triki <salah.triki@gmail.com>
Link: https://lore.kernel.org/r/20210702133114.GA314157@pc


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 36cdc20b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;