Module Name: src
Committed By: mlelstv
Date: Mon Mar 28 11:09:24 UTC 2022
Modified Files:
src/sys/dev/spi: spi.c
Log Message:
Fix sanity check for zero sized buffer.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/spi/spi.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/spi/spi.c
diff -u src/sys/dev/spi/spi.c:1.23 src/sys/dev/spi/spi.c:1.24
--- src/sys/dev/spi/spi.c:1.23 Wed Jan 19 13:33:11 2022
+++ src/sys/dev/spi/spi.c Mon Mar 28 11:09:24 2022
@@ -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 *d
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;
}