Skip to content

Commit 6e57238

Browse files
author
Roman Rashchupkin
committed
Fix storage_lookup_patches return code in case
process already terminated and buildids can't be found.
1 parent 9752ec3 commit 6e57238

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/kpatch_storage.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int storage_lookup_patches(kpatch_storage_t *storage, kpatch_process_t *proc)
398398
struct kp_file *pkpfile;
399399
struct object_file *o;
400400
const char *bid;
401-
int found = 0, ret;
401+
int found = -1, ret;
402402

403403
list_for_each_entry(o, &proc->objs, list) {
404404
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)
410410
o->name);
411411
continue;
412412
}
413+
if (found < 0)
414+
found = 0;
413415

414416
ret = storage_load_patch(storage, bid, &pkpfile);
415417
if (ret == PATCH_OPEN_ERROR) {

0 commit comments

Comments
 (0)