diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c index f5396f26ddb48c38a2d74e8f070be912e8ff461f..f9ec38281ff208022ea24b1c8dd2055be3704b0a 100644 --- a/drivers/mtd/devices/powernv_flash.c +++ b/drivers/mtd/devices/powernv_flash.c @@ -78,7 +78,9 @@ static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op, rc = opal_flash_erase(info->id, offset, len, token); break; default: - BUG_ON(1); + WARN_ON_ONCE(1); + opal_async_release_token(token); + return -EIO; } if (rc != OPAL_ASYNC_COMPLETION) {