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:
parent
36cdc20b79
commit
d1d26f40f7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue