diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 99d4fbffb0dfd574acd2f280c960895548254791..9bfe329fb579a3e4ffd20072c23ae5bba7b5e0d9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3705,6 +3705,10 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) "%llu != %llu\n", (unsigned long long)n_sectors, (unsigned long long)dev->n_sectors); + + /* restore original n_sectors */ + dev->n_sectors = n_sectors; + rc = -ENODEV; goto fail; }