Whamcloud - gitweb
LU-2394 llog: Fix a NULL pointer dereference
authorPrakash Surya <surya1@llnl.gov>
Mon, 26 Nov 2012 23:54:15 +0000 (15:54 -0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Nov 2012 00:27:23 +0000 (19:27 -0500)
commite6ea6e70cd91f01334957f421b5692dbaa6ad75b
tree2811cdafb00021eb39c0b335a87a3be2b2038da6
parentf80de57540450eeac3a1c3a09efaac803c027f53
LU-2394 llog: Fix a NULL pointer dereference

If llog_cat_id2handle fails and returns a positive value, it may free
its 'res' parameter and set it to NULL. Thus, a caller must be cautious
not to cause a NULL pointer dereference on error.

This patch fixes the cat_cancel_cb function, keeping it from dereferencing
this potentially NULL pointer.

In addition, any console message regarding a failed call to
llog_cat_id2handle in llog_cat.c now outputs the same message.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I949b558d0ea4569685e8ed85b7a920b2dca548c3
Reviewed-on: http://review.whamcloud.com/4676
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
lustre/obdclass/llog_cat.c