Cash value of free stock

Assalamu alaykum!

I have a friend who signed up to a trading platform through my referral link, and we both got the cash value of a random stock. If the stock itself where the cash value comes from, is non-shariah compliant, does that make the money they gave us (we never had possession of the actual stock) impermissible?

Thank you