Whamcloud - gitweb
LU-4698 target: check for NULL tgt before deref 36/9936/10
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Fri, 11 Apr 2014 20:29:07 +0000 (16:29 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 7 May 2015 16:17:57 +0000 (16:17 +0000)
commit4b3cea8249337dd6e5037b5fb7e4557efa92de5a
treedfd96cddf97fb3508e34efbd194c6f4ed2e1f00f
parent3ededde903c92f8485cae0dc9f958f194ff0b140
LU-4698 target: check for NULL tgt before deref

In the case of and echo server during obdfilter-survey tests a target
can be missing from the obd_device.
Check for a valid pointer before dereferencing it, return error if
it's NULL.
Check for valid obt in class_exp2tgt otherwise return NULL target.
Add checks for all places that call class_exp2tgt for NULL return
value.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I27a3020dc7ef9943fb600c3ddb6432f7f67f8b39
Reviewed-on: http://review.whamcloud.com/9936
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_class.h
lustre/target/tgt_handler.c
lustre/target/tgt_lastrcvd.c