Skip to content

Commit

Permalink
Fix storage_lookup_patches return code in case
Browse files Browse the repository at this point in the history
process already terminated and buildids can't be found.
  • Loading branch information
Roman Rashchupkin committed Feb 7, 2018
1 parent 9752ec3 commit 6e57238
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/kpatch_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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) {
Expand Down

0 comments on commit 6e57238

Please sign in to comment.