As for your examples, Linus didn't invent. He made a version of an existing OS and started with an existing version of a copy of that OS. He did it for fun, but one must also recognize that he's gained a tremendous amount by this seemingly "benevolent" action. Fresh out of college he could take much more interesting jobs than most people with his background could. His "gift" ended up being a loss leader for his career.
So if we were reliant on only having people like Tesla to push us forward we'd be nowhere near where we are today. Tesla was brilliant but there are just far too few people who think and work as he did.