diff --git a/smb2pdu.c b/smb2pdu.c index 79c155418..de7a1abb1 100644 --- a/smb2pdu.c +++ b/smb2pdu.c @@ -4563,7 +4563,7 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp, if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) name_len -= XATTR_USER_PREFIX_LEN; - ptr = (char *)(&eainfo->name + name_len + 1); + ptr = eainfo->name + name_len + 1; buf_free_len -= (offsetof(struct smb2_ea_info, name) + name_len + 1); /* bailout if xattr can't fit in buf_free_len */ diff --git a/smb2pdu.h b/smb2pdu.h index b0b9cbbf4..1ad06336a 100644 --- a/smb2pdu.h +++ b/smb2pdu.h @@ -1569,7 +1569,7 @@ struct smb2_ea_info { __u8 Flags; __u8 EaNameLength; __le16 EaValueLength; - char name[1]; + char name[]; /* optionally followed by value */ } __packed; /* level 15 Query */