diff --git a/common/bbu.c b/common/bbu.c index c5dda8c8b..031c43382 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -109,6 +109,15 @@ static struct bbu_handler *bbu_find_handler_by_device(const char *devicepath) if (!devicepath) return NULL; + list_for_each_entry(handler, &bbu_image_handlers, list) + if (!strcmp(handler->devicefile, devicepath)) + return handler; + + if (strncmp(devicepath, "/dev/", 5)) + return NULL; + + devicepath += 5; + list_for_each_entry(handler, &bbu_image_handlers, list) if (!strcmp(handler->devicefile, devicepath)) return handler;