libmultipath: fix memory issue in path_latency prio
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 9 Oct 2018 23:03:07 +0000 (18:03 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 10 Oct 2018 06:09:36 +0000 (08:09 +0200)
commitc3b739527258dae7ebe4b5d083a33ce527675082
treeecffe0cd690325bbe20bfb259bd80c61a45b0b86
parent0a950aa6bb35876fe6f3e0ff4a496cc80878c01b
libmultipath: fix memory issue in path_latency prio

The path_latency prioriziter was assuming that prepare_directio_read()
always succeeds. However, it doesn't, and when it fails, the prioritizer
used buf without it pointing to alloced memory. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/prioritizers/path_latency.c