Lamar Odom is worried for Bam Margera ... worried he's keeping bad company.
As we first reported ... Bam was detoxing in San Diego earlier this month with Lamar's help, but he left early, and given Bam's track record, Lamar is concerned.
Lamar clearly thinks Bam is hanging with the wrong crowd, saying, "Who you surround yourself with is critical. We are the company we keep."
Bam actually stayed with Lamar last weekend after leaving the detox center, but he bounced and Odom thinks that's more than problematic.
Lamar thinks there's a card his friends and family can play that could get Bam's attention ... namely his ability to see is son, Phoenix.
Remember, Bam threatened to smoke crack until he died if he couldn't see his kid, so that could be a pressure point that works.
Lamar says he's going to try and track Bam down and encourage him to go to rehab at the Odom Recovery Group.
Stay tuned ...