Did it work in the past? Did you buy it from the internet? What brand is it? What size is it?
If you bought it from the internet then it is possible you have been sold a "fake" flash drive. By that I mean they take a malfunctioning chip with a small ize, for example 512MB and flash it so it appears larger, for example 8GB or even 64GB. This can be fixed but to be honest it is not worth it as the chip is faulty in the first place.
If it was bought from a shop, and it is a Samsung, then they have had a batch of bad chips and it just needs to be returned.