summaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>2017-12-06 10:47:04 +0900
committerDavid S. Miller <davem@davemloft.net>2017-12-06 15:02:48 -0500
commitd9b8693783e8a1ce8e4495d13d1dd6d8081f5070 (patch)
tree2f9855e0ae6940edff0ac5fe79182b1672a6fedf /net/rds
parent4bee00eb25a7b487706d17926db4679ae8f0e411 (diff)
downloadlinux-d9b8693783e8a1ce8e4495d13d1dd6d8081f5070.tar.gz
linux-d9b8693783e8a1ce8e4495d13d1dd6d8081f5070.tar.bz2
linux-d9b8693783e8a1ce8e4495d13d1dd6d8081f5070.zip
rds: debug: fix null check on static array
t_name cannot be NULL since it is an array field of a struct. Replacing null check on static array with string length check using strnlen() Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 9efc82c665b5..6492c0b608a4 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -230,8 +230,8 @@ static struct rds_connection *__rds_conn_create(struct net *net,
rdsdebug("allocated conn %p for %pI4 -> %pI4 over %s %s\n",
conn, &laddr, &faddr,
- trans->t_name ? trans->t_name : "[unknown]",
- is_outgoing ? "(outgoing)" : "");
+ strnlen(trans->t_name, sizeof(trans->t_name)) ? trans->t_name :
+ "[unknown]", is_outgoing ? "(outgoing)" : "");
/*
* Since we ran without holding the conn lock, someone could