Look up "fruits of the poisonous tree". Basically just means if you can legally search an area whatever you find is fair. If the initial search is bad then everything found is bad. That's a very basic summation of it.
You mentioned warrants, same applies. You need to be detailed in your warrant in what your looking for. For example if your looking for a stolen car then if your looking in a underwear draw and find a gun it would most likely get tossed seeing as how stolen cars don't fit in underwear drawers. (Your honor my client can't fit a camaro in that drawer it was full of drugs!!) (Your honor we were looking for the keys to the stolen car....)
I'm not familiar with California case lawn or their K9 procedure. I do know each States supreme court have ruled every which way on drug sniffs and new case law comes out a few times a year.
My point is that if the initial search is good (for drugs) then yes the gun will be good. If that k9 sniff is bad or gets tossed then anything found based on that is tossed.
Sent from my XT907 using Tapatalk