diff options
author | Hyunchul Lee <hyc.lee@gmail.com> | 2021-07-12 19:34:02 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-31 08:22:38 +0200 |
commit | c30f239f06f6b1a6c0a6ddb2a3d628a815415f0d (patch) | |
tree | 38de8a27019f03289a5b3cb6276f061402fe7c05 /fs | |
parent | 78d282f23bec739a4a3ca73b538368f009cb4a7a (diff) | |
download | linux-stable-c30f239f06f6b1a6c0a6ddb2a3d628a815415f0d.tar.gz linux-stable-c30f239f06f6b1a6c0a6ddb2a3d628a815415f0d.tar.bz2 linux-stable-c30f239f06f6b1a6c0a6ddb2a3d628a815415f0d.zip |
cifs: fix the out of range assignment to bit fields in parse_server_interfaces
[ Upstream commit c9c9c6815f9004ee1ec87401ed0796853bd70f1b ]
Because the out of range assignment to bit fields
are compiler-dependant, the fields could have wrong
value.
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/smb2ops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 5a14f518cd97..61955a7c838b 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -386,8 +386,8 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, p = buf; while (bytes_left >= sizeof(*p)) { info->speed = le64_to_cpu(p->LinkSpeed); - info->rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE); - info->rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE); + info->rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE) ? 1 : 0; + info->rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE) ? 1 : 0; cifs_dbg(FYI, "%s: adding iface %zu\n", __func__, *iface_count); cifs_dbg(FYI, "%s: speed %zu bps\n", __func__, info->speed); |