OSDN Git Service

staging: lustre: remove last entry of libcfs_netstrfns[]
authorFrederic Saunier <frederic.saunier@atos.net>
Thu, 22 Oct 2015 01:52:48 +0000 (21:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 01:52:21 +0000 (18:52 -0700)
commit1a1e76c07dacf774cd047aad62e8daa315433967
tree62b7c84c977d52c59385dff750d915af98aadaaf
parent80feb1ef349ed03f121c086c02579ee9a08bb343
staging: lustre: remove last entry of libcfs_netstrfns[]

Currently NID string handling test for the last entry,
and last entry has .nf_type == (__u32) -1. If we ask
for a non existent LND we hit the last entry which then
calls a strlen on a NULL which causes a error. We can
avoid this problem if we just remove the last entry
since it is not used for anything except as a last
entry marker.

Signed-off-by: Frederic Saunier <frederic.saunier@atos.net>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6501
Reviewed-on: http://review.whamcloud.com/15424
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/lnet/nidstrings.c