From 61ef738d5edd1adc9b6d7cb8b762e08ac4782abe Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 13 Jan 2018 16:32:09 +0000 Subject: [PATCH] Fix a bug introduced in r327355; in mmcsd_ioctl_cmd() when ensuring that userland doesn't switch partitions on its own, compare against the partition mmcsd_ioctl_cmd() is going to switch to (based on the device node used) rather than the currently selected partition. --- sys/dev/mmc/mmcsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 61680e1ea94a..bd3a13d01b50 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -920,7 +920,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag) */ if (cmd.opcode == MMC_SWITCH_FUNC && dp != NULL && (((uint8_t *)dp)[EXT_CSD_PART_CONFIG] & - EXT_CSD_PART_CONFIG_ACC_MASK) != sc->part_curr) { + EXT_CSD_PART_CONFIG_ACC_MASK) != part->type) { err = EINVAL; goto out; }