diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index b295e1744ea10a2b73ded42b4758d6de1905efed..a24eba5ea843e632af7e07962e520d2271f7ae6b 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -380,6 +380,11 @@ static void sur40_process_video(struct sur40_state *sur40) /* get a new buffer from the list */ spin_lock(&sur40->qlock); + if (list_empty(&sur40->buf_list)) { + dev_dbg(sur40->dev, "buffer queue empty\n"); + spin_unlock(&sur40->qlock); + return; + } new_buf = list_entry(sur40->buf_list.next, struct sur40_buffer, list); list_del(&new_buf->list); spin_unlock(&sur40->qlock);