From: Karsten Graul Date: Wed, 14 Oct 2020 17:43:28 +0000 (+0200) Subject: net/smc: fix valid DMBE buffer sizes X-Git-Tag: v5.8.17~619 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91119131f8a8e96816e746a4e2d4b6d3b3bd1faf;p=thirdparty%2Fkernel%2Fstable.git net/smc: fix valid DMBE buffer sizes [ Upstream commit ef12ad45880b696eb993d86c481ca891836ab593 ] The SMCD_DMBE_SIZES should include all valid DMBE buffer sizes, so the correct value is 6 which means 1MB. With 7 the registration of an ISM buffer would always fail because of the invalid size requested. Fix that and set the value to 6. Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM") Signed-off-by: Karsten Graul Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index f82a2e5999171..49696f464794f 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -1595,7 +1595,7 @@ out: return rc; } -#define SMCD_DMBE_SIZES 7 /* 0 -> 16KB, 1 -> 32KB, .. 6 -> 1MB */ +#define SMCD_DMBE_SIZES 6 /* 0 -> 16KB, 1 -> 32KB, .. 6 -> 1MB */ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr, bool is_dmb, int bufsize)