Details
-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
Lustre 2.8.0
-
None
-
3
-
9223372036854775807
Description
After the merger of LU-6070 to the upstream client Dan Carpenter reported the follow smatch warning:
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:676 lprocfs_rd_import()
warn: variable dereferenced before check 'imp->imp_connection' (see line 668)
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
667 }
668 libcfs_nid2str_r(imp->imp_connection->c_peer.nid,
^^^^^^^^^^^^^^^^^^^^^
Patch introduces a new dereference.
669 nidstr, sizeof(nidstr));
670 seq_printf(m,
671 "]\n"
672 " current_connection: %s\n"
673 " connection_attempts: %u\n"
674 " generation: %u\n"
675 " in-progress_invalidations: %u\n",
676 imp->imp_connection == NULL ? "<none>" : nidstr,
^^^^^^^^^^^^^^^^^^^
Old code assumes it can be NULL.
677 imp->imp_conn_cnt,
678 imp->imp_generation,