librbd: get_parent_info should protect against invalid parent

get_parent_info should return -ENOENT if the image does not
have an associated parent image.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 21afd0ef8e)
This commit is contained in:
Jason Dillaman 2015-03-16 18:35:07 -04:00
parent 28787d2184
commit 572a2f5707

View File

@ -1426,6 +1426,9 @@ reprotect_and_return_err:
RWLock::RLocker l(ictx->snap_lock);
RWLock::RLocker l2(ictx->parent_lock);
if (ictx->parent == NULL) {
return -ENOENT;
}
parent_spec parent_spec;