netlink_smc_diag: fix off-by-one error in xlat lookup

* netlink_smc_diag.c (decode_smc_diag_shutdown): Decrement xlat size
by one to account for XLAT_END as other users of xlats do.

Fixes: v4.25~54 "netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value"
This commit is contained in:
Дмитрий Левин 2018-12-23 22:12:36 +00:00
parent 986a55423e
commit 73f565d1b8

View File

@ -136,7 +136,7 @@ decode_smc_diag_shutdown(struct tcb *const tcp,
const void *const opaque_data)
{
const struct decode_nla_xlat_opts opts = {
ARRSZ_PAIR(sock_shutdown_flags), "???_SHUTDOWN",
ARRSZ_PAIR(sock_shutdown_flags) - 1, "???_SHUTDOWN",
.size = 1,
};