ALSA: pcm_lib: fix "something must be really wrong" condition

When runtime->periods == 1 or when pointer crosses end of ring buffer,
the delta might be greater than buffer_size.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index a632262..c7b35b2 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -362,7 +362,7 @@
 			   (unsigned long)runtime->hw_ptr_base);
 	}
 	/* something must be really wrong */
-	if (delta >= runtime->buffer_size) {
+	if (delta >= runtime->buffer_size + runtime->period_size) {
 		hw_ptr_error(substream,
 			       "Unexpected hw_pointer value %s"
 			       "(stream=%i, pos=%ld, new_hw_ptr=%ld, "