提交 08b01832 编写于 作者: S Stefan Weil 提交者: David S. Miller

s390: Fix possibly wrong size in strncmp (smsgiucv)

This error was reported by cppcheck:
drivers/s390/net/smsgiucv.c:63: error: Using sizeof for array given as
function argument returns the size of pointer.

Although there is no runtime problem as long as sizeof(u8 *) == 8,
this misleading code should get fixed.
Signed-off-by: NStefan Weil <weil@mail.berlios.de>
Signed-off-by: NFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5df979d6
...@@ -60,7 +60,7 @@ static struct iucv_handler smsg_handler = { ...@@ -60,7 +60,7 @@ static struct iucv_handler smsg_handler = {
static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8],
u8 ipuser[16]) u8 ipuser[16])
{ {
if (strncmp(ipvmid, "*MSG ", sizeof(ipvmid)) != 0) if (strncmp(ipvmid, "*MSG ", 8) != 0)
return -EINVAL; return -EINVAL;
/* Path pending from *MSG. */ /* Path pending from *MSG. */
return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL); return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册