From e973ad2298e6e926c9a484cd581d4d15833be9dd Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sat, 7 Apr 2018 21:31:09 +0000 Subject: [PATCH] Don't check for impossible NULL return from malloc(..., M_WAITOK). --- sys/dev/spibus/spigen.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/dev/spibus/spigen.c b/sys/dev/spibus/spigen.c index ccb5bf1b3a2a..9283474b5faf 100644 --- a/sys/dev/spibus/spigen.c +++ b/sys/dev/spibus/spigen.c @@ -242,15 +242,9 @@ spigen_transfer(struct cdev *cdev, struct spigen_transfer *st) #endif transfer.tx_cmd = transfer.rx_cmd = malloc(st->st_command.iov_len, M_DEVBUF, M_WAITOK); - if (transfer.tx_cmd == NULL) - return (ENOMEM); if (st->st_data.iov_len > 0) { transfer.tx_data = transfer.rx_data = malloc(st->st_data.iov_len, M_DEVBUF, M_WAITOK); - if (transfer.tx_data == NULL) { - free(transfer.tx_cmd, M_DEVBUF); - return (ENOMEM); - } } else transfer.tx_data = transfer.rx_data = NULL;