Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jan 2018 16:32:09 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327926 - head/sys/dev/mmc
Message-ID:  <201801131632.w0DGW9xt034278@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sat Jan 13 16:32:09 2018
New Revision: 327926
URL: https://svnweb.freebsd.org/changeset/base/327926

Log:
  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.

Modified:
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmcsd.c
==============================================================================
--- head/sys/dev/mmc/mmcsd.c	Sat Jan 13 16:31:07 2018	(r327925)
+++ head/sys/dev/mmc/mmcsd.c	Sat Jan 13 16:32:09 2018	(r327926)
@@ -920,7 +920,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io
 		 */
 		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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801131632.w0DGW9xt034278>