Module Name:    src
Committed By:   riastradh
Date:           Sat Mar 12 21:15:25 UTC 2022

Modified Files:
        src/sys/dev/usb: ustir.c

Log Message:
ustir(4): Avoid undefined behaviour if register read fails.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/ustir.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/usb/ustir.c
diff -u src/sys/dev/usb/ustir.c:1.50 src/sys/dev/usb/ustir.c:1.51
--- src/sys/dev/usb/ustir.c:1.50	Sun Sep 26 01:16:09 2021
+++ src/sys/dev/usb/ustir.c	Sat Mar 12 21:15:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ustir.c,v 1.50 2021/09/26 01:16:09 thorpej Exp $	*/
+/*	$NetBSD: ustir.c,v 1.51 2022/03/12 21:15:25 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.50 2021/09/26 01:16:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.51 2022/03/12 21:15:25 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1144,7 +1144,7 @@ Static int ustir_ioctl(void *h, u_long c
 	int error;
 	unsigned int regnum;
 	usbd_status err;
-	uint8_t regdata;
+	uint8_t regdata = 0;
 
 	if (sc->sc_dying)
 		return EIO;

Reply via email to