diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2018-06-04 15:04:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2018-06-04 15:04:58 +0000 |
commit | 2f00ae092b312b1ac6fd3a6c8f430368c84ae10d (patch) | |
tree | f9d3d3bf07c9f26d43ccf1a23c5a93eaac60d793 /sys/dev | |
parent | 73c98b2862be8227db0b54c6c28c379e4b1f6997 (diff) |
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')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_io.c | 8 |
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)) |