I don't think I've heard up the river as a term for prison before. Up the creek just means in trouble without any obvious way out.

Bingley


Bingley