No karma becomes void unless truth is realized. Hence for mortals like us this option does not arise.
Now coming to your fundamental question, karmas can be divided into many categories like nishkama karma, kamya karma etc. Karma associated with your question falls under Kamya karma which means a person desires something from his karma. No issues from doing such karma, instead its good too but not the best because Nishkama karma is the best. If good deeds are done, definitively good fruits will come to you, but might not be always as below example illustrates.
Example:Person X goes to office with a sweet box. On the way, in road he sees a poor man Y who is about to die. Feeling pity on him, X gives a sweet and then goes. After eating sweet, Y dies as he was suffering from acute diabetes. Now X did a good karma with good intention but result was not good.
Hence a person must do Karmas without desires. Also karmas done without desires purify your mind and will help in spiritual progress.
Sources:According to book "eternal laws" (published by Sringeri Mutt publications)