summaryrefslogtreecommitdiffstats
path: root/net/caif/cfdbgl.c
diff options
context:
space:
mode:
authorswkhack2019-05-17 09:59:22 +0200
committerDavid S. Miller2019-05-17 20:31:15 +0200
commit34dcf6a1902ac214149a2742250ff03aa5346f3e (patch)
treed0d0b9aedcb5e2cc02f627b2e1b909befd29a1e2 /net/caif/cfdbgl.c
parentipv6: fix src addr routing with the exception table (diff)
downloadkernel-qcow2-linux-34dcf6a1902ac214149a2742250ff03aa5346f3e.tar.gz
kernel-qcow2-linux-34dcf6a1902ac214149a2742250ff03aa5346f3e.tar.xz
kernel-qcow2-linux-34dcf6a1902ac214149a2742250ff03aa5346f3e.zip
net: caif: fix the value of size argument of snprintf
Because the function snprintf write at most size bytes(including the null byte).So the value of the argument size need not to minus one. Signed-off-by: swkhack <swkhack@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/cfdbgl.c')
-rw-r--r--net/caif/cfdbgl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/caif/cfdbgl.c b/net/caif/cfdbgl.c
index 7aae0b56829e..cce839bf49f7 100644
--- a/net/caif/cfdbgl.c
+++ b/net/caif/cfdbgl.c
@@ -26,7 +26,7 @@ struct cflayer *cfdbgl_create(u8 channel_id, struct dev_info *dev_info)
cfsrvl_init(dbg, channel_id, dev_info, false);
dbg->layer.receive = cfdbgl_receive;
dbg->layer.transmit = cfdbgl_transmit;
- snprintf(dbg->layer.name, CAIF_LAYER_NAME_SZ - 1, "dbg%d", channel_id);
+ snprintf(dbg->layer.name, CAIF_LAYER_NAME_SZ, "dbg%d", channel_id);
return &dbg->layer;
}