Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 2023 06:57:18 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8974b83aa1a0 - stable/13 - sdio: Do not allow setting a block size if function doesn't support it
Message-ID:  <202302020657.3126vIWI003765@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=8974b83aa1a077bc038f59c0909e4698f88a5904

commit 8974b83aa1a077bc038f59c0909e4698f88a5904
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2021-05-26 11:15:58 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2023-02-02 06:47:34 +0000

    sdio: Do not allow setting a block size if function doesn't support it
    
    (cherry picked from commit 49da0242e798ade8a578036929bff493a2d6ef75)
---
 sys/dev/sdio/sdio_subr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/sdio/sdio_subr.c b/sys/dev/sdio/sdio_subr.c
index 0885b16550a6..50b741ff2a27 100644
--- a/sys/dev/sdio/sdio_subr.c
+++ b/sys/dev/sdio/sdio_subr.c
@@ -121,6 +121,9 @@ sdio_set_block_size(struct sdio_func *f, uint16_t bs)
 	uint32_t addr;
 	uint16_t v;
 
+	if (bs > f->max_blksize)
+		return (EOPNOTSUPP);
+
 	if (!sdio_get_support_multiblk(f->dev))
 		return (EOPNOTSUPP);
 



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