Module Name:    src
Committed By:   thorpej
Date:           Sun May 16 21:04:59 UTC 2021

Modified Files:
        src/sys/dev/i2c [thorpej-i2c-spi-conf]: i2c.c

Log Message:
Check for errors from iic_acquire_bus() in iic_ioctl_exec().


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.4 -r1.78.2.5 src/sys/dev/i2c/i2c.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/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.78.2.4 src/sys/dev/i2c/i2c.c:1.78.2.5
--- src/sys/dev/i2c/i2c.c:1.78.2.4	Sun May 16 21:03:38 2021
+++ src/sys/dev/i2c/i2c.c	Sun May 16 21:04:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.78.2.4 2021/05/16 21:03:38 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.78.2.5 2021/05/16 21:04:59 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.78.2.4 2021/05/16 21:03:38 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.78.2.5 2021/05/16 21:04:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1005,7 +1005,9 @@ iic_ioctl_exec(struct iic_softc *sc, i2c
 			goto out;
 	}
 
-	iic_acquire_bus(ic, 0);
+	if ((error = iic_acquire_bus(ic, 0)) != 0) {
+		goto out;
+	}
 	error = iic_exec(ic, iie->iie_op, iie->iie_addr, cmd, iie->iie_cmdlen,
 	    buf, iie->iie_buflen, 0);
 	iic_release_bus(ic, 0);

Reply via email to