If it is just part of a riff it is very easy to think, "Hey that sound's familiar". But don't let it stop you completely. If you listen to the solo from "Sunshine of your love" by Cream, It screams the melody of "Blue Moon". If you remember the Alan Parson's project (Hell, you get points if you remember the 70's here

), he uses quite a few eeerily familiar riffs. And there is the current hype about the Red Hot Chili Peppers latest single sounding like a Tom Petty song (the intro and opening verse are very similar but that is about where it ends). And then there are all the blues bits out there that sound a lot like Robert Johnson riffs, but I have even read folks who dismissed RJ himself as being too derivative of some of his other contemporaries.
Bottom line is I guess, If you come up with something and it sounds good, play it and play it loud

If it sounds a little familiar then only worry if you plan on going commercial with it, in which case, call it a tribute and play it loud
Cheers
Peter