summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormlelstv <mlelstv@NetBSD.org>2022-03-28 11:09:24 +0000
committermlelstv <mlelstv@NetBSD.org>2022-03-28 11:09:24 +0000
commit65c70892b50700a386241a2f6067cb57daa8f677 (patch)
treeda13b328b8e33567e1d7f3be386cd3d2bd9ba8e1 /sys/dev
parent3d84144c6c954a86ab7b2e9bdbfefc96309abd3e (diff)
Fix sanity check for zero sized buffer.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/spi/spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/spi/spi.c b/sys/dev/spi/spi.c
index 3e8a6a115f7..5594a2ee2db 100644
--- a/sys/dev/spi/spi.c
+++ b/sys/dev/spi/spi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.23 2022/01/19 13:33:11 thorpej Exp $ */
+/* $NetBSD: spi.c,v 1.24 2022/03/28 11:09:24 mlelstv Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.23 2022/01/19 13:33:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.24 2022/03/28 11:09:24 mlelstv Exp $");
#include "locators.h"
@@ -380,7 +380,7 @@ spi_ioctl(dev_t dev, u_long cmd, void *data, int flag, lwp_t *l)
break;
}
if ((sit->sit_send && sit->sit_sendlen == 0)
- || (sit->sit_recv && sit->sit_recv == 0)) {
+ || (sit->sit_recv && sit->sit_recvlen == 0)) {
error = EINVAL;
break;
}