We consider a compound Poisson risk model in which the premium rate changes when the surplus exceeds a threshold. The explicit form of the ruin probability for the risk model is obtained by deriving and using the overflow probability of the workload process in the corresponding M/G/1 queueing model.