From 6e57238ba303db87adbbd6129ac7aedbf373e95b Mon Sep 17 00:00:00 2001 From: Roman Rashchupkin Date: Wed, 7 Feb 2018 12:50:25 +0300 Subject: [PATCH] Fix storage_lookup_patches return code in case process already terminated and buildids can't be found. --- src/kpatch_storage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kpatch_storage.c b/src/kpatch_storage.c index a466460..6dbadac 100644 --- a/src/kpatch_storage.c +++ b/src/kpatch_storage.c @@ -398,7 +398,7 @@ int storage_lookup_patches(kpatch_storage_t *storage, kpatch_process_t *proc) struct kp_file *pkpfile; struct object_file *o; const char *bid; - int found = 0, ret; + int found = -1, ret; list_for_each_entry(o, &proc->objs, list) { if (!o->is_elf || is_kernel_object_name(o->name)) @@ -410,6 +410,8 @@ int storage_lookup_patches(kpatch_storage_t *storage, kpatch_process_t *proc) o->name); continue; } + if (found < 0) + found = 0; ret = storage_load_patch(storage, bid, &pkpfile); if (ret == PATCH_OPEN_ERROR) {