arm: socfpga: Fix mailbox command length checking
Subsystems (3)
PATCH 1/1 arm: socfpga: Fix mailbox command length checking
A mailbox command including header + arguments.
But, "len" only including length of arguments, it missed the length of header in checking.
Includes length of header (1) when checking the space size.
--- arch/arm/mach-socfpga/mailbox_s10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-socfpga/mailbox_s10.c +1 -1
@@ -59,7 +59,7 @@ static __always_inline int mbox_fill_cmd_circular_buff(u32 header, u32 len,*/ if (((cin +1 ) %MBOX_CMD_BUFFER_SIZE ) == cout || ((MBOX_CMD_BUFFER_SIZE - cin + cout -1 ) % -MBOX_CMD_BUFFER_SIZE ) < len) +MBOX_CMD_BUFFER_SIZE ) < (len +1 ))return -ENOMEM ;/* write header to circular buffer */
Signature · 1 line
2.19.0
PATCH 1/1 arm: socfpga: Fix mailbox command length checking
Quoted 4 lines · Ley Foon Tan
A mailbox command including header + arguments.
But, "len" only including length of arguments, it missed the length of header in checking.
Includes length of header (1) when checking the space size.
I think the commit message could use some improvement, maybe reword it so it's clear what you're fixing here. I guess it's some off-by-one error ?
Quoted 20 lines
Signed-off-by Ley Foon Tan <[email protected]>Signed-off-by Chee Hong Ang <[email protected]>--- arch/arm/mach-socfpga/mailbox_s10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-socfpga/mailbox_s10.c +1
-1@@ -59,7 +59,7 @@ static __always_inline int mbox_fill_cmd_circular_buff(u32 header, u32 len,*/ if (((cin +1 ) %MBOX_CMD_BUFFER_SIZE ) == cout || ((MBOX_CMD_BUFFER_SIZE - cin + cout -1 ) % -MBOX_CMD_BUFFER_SIZE ) < len) +MBOX_CMD_BUFFER_SIZE ) < (len +1 ))return -ENOMEM ;/* write header to circular buffer */
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 arm: socfpga: Fix mailbox command length checking
Quoted 9 lines · Marek Vasut
Quoted 4 lines · Ley Foon Tan
A mailbox command including header + arguments.
But, "len" only including length of arguments, it missed the length of header in checking.
Includes length of header (1) when checking the space size.I think the commit message could use some improvement, maybe reword it so it's clear what you're fixing here. I guess it's some off-by-one error ?
Okay, will resend again.
Thanks.
Regards
Ley Foon
PATCH 1/1 arm: socfpga: Fix mailbox command length checking
Quoted 11 lines · Ley Foon Tan
Quoted 9 lines · Marek Vasut
Quoted 4 lines · Ley Foon Tan
A mailbox command including header + arguments.
But, "len" only including length of arguments, it missed the length of header in checking.
Includes length of header (1) when checking the space size.I think the commit message could use some improvement, maybe reword it so it's clear what you're fixing here. I guess it's some off-by-one error ?
Okay, will resend again.
Thanks. The patch itself is fine.
Signature · 2 lines
Best regards, Marek Vasut