summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdmmc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-06-04 15:04:57 +0000
committerderaadt <deraadt@openbsd.org>2018-06-04 15:04:57 +0000
commitb427a8277c23f7b6b25c6f558f5b85934b03f506 (patch)
treea69e10d061e7e5d3846e0419f899d9768be59ea1 /sys/dev/sdmmc
parent4-bit bus width is mandatory for SDIO cards that support High Speed (diff)
downloadwireguard-openbsd-b427a8277c23f7b6b25c6f558f5b85934b03f506.tar.xz
wireguard-openbsd-b427a8277c23f7b6b25c6f558f5b85934b03f506.zip
in non-DIAGNOSTIC kernels, rw_assert_wrlock becomes a nop which leaves the
local variable dangling, so calculate the lock address by hand at invocation ok kettenis
Diffstat (limited to 'sys/dev/sdmmc')
-rw-r--r--sys/dev/sdmmc/sdmmc_io.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/sdmmc/sdmmc_io.c b/sys/dev/sdmmc/sdmmc_io.c
index d3848b696a5..3b8effc7943 100644
--- a/sys/dev/sdmmc/sdmmc_io.c
+++ b/sys/dev/sdmmc/sdmmc_io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc_io.c,v 1.37 2018/06/04 13:33:10 patrick Exp $ */
+/* $OpenBSD: sdmmc_io.c,v 1.38 2018/06/04 15:04:57 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -871,10 +871,9 @@ sdmmc_io_set_blocklen(struct sdmmc_function *sf, unsigned int blklen)
void
sdmmc_io_set_bus_width(struct sdmmc_function *sf, int width)
{
- struct sdmmc_softc *sc = sf->sc;
u_int8_t rv;
- rw_assert_wrlock(&sc->sc_lock);
+ rw_assert_wrlock(&sf->sc->sc_lock);
rv = sdmmc_io_read_1(sf, SD_IO_CCCR_BUS_WIDTH);
rv &= ~CCCR_BUS_WIDTH_MASK;
if (width == 4)
@@ -887,10 +886,9 @@ sdmmc_io_set_bus_width(struct sdmmc_function *sf, int width)
int
sdmmc_io_set_highspeed(struct sdmmc_function *sf, int enable)
{
- struct sdmmc_softc *sc = sf->sc;
u_int8_t rv;
- rw_assert_wrlock(&sc->sc_lock);
+ rw_assert_wrlock(&sf->sc->sc_lock);
rv = sdmmc_io_read_1(sf, SD_IO_CCCR_SPEED);
if (enable && !(rv & CCCR_SPEED_SHS))