From ccf98fe9312539aca1154a9462d611d8fdc4f5fa Mon Sep 17 00:00:00 2001 From: CTurt Date: Sat, 30 Jan 2016 10:05:23 +0000 Subject: [PATCH] HBSD: Additional copyin check Signed-off-by: CTurt --- sys/dev/tdfx/tdfx_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index 0d50af633fe8..b80c2fbede32 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -710,7 +710,8 @@ tdfx_do_pio_wt(struct tdfx_pio_data *piod) } /* Write the data to the intended port */ - copyin(piod->value, &ret_byte, sizeof(u_int8_t)); + if (copyin(piod->value, &ret_byte, sizeof(u_int8_t))) + return -EFAULT; workport = piod->port; outb(workport, ret_byte); return 0;