diff --git a/target/linux/lantiq/patches-3.10/0007-MIPS-lantiq-handle-vmmc-memory-reservation.patch b/target/linux/lantiq/patches-3.10/0007-MIPS-lantiq-handle-vmmc-memory-reservation.patch
index 07180637e5ff2ff0fca647f4c5265d57a1c19677..d1b1e08a4720d2b28cf442cd261b85b894484571 100644
--- a/target/linux/lantiq/patches-3.10/0007-MIPS-lantiq-handle-vmmc-memory-reservation.patch
+++ b/target/linux/lantiq/patches-3.10/0007-MIPS-lantiq-handle-vmmc-memory-reservation.patch
@@ -54,7 +54,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +		(void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
 +
 +	gpio_count = of_gpio_count(pdev->dev.of_node);
-+	while (gpio_count) {
++	while (gpio_count > 0) {
 +		enum of_gpio_flags flags;
 +		int gpio = of_get_gpio_flags(pdev->dev.of_node, --gpio_count, &flags);
 +		if (gpio_request(gpio, "vmmc-relay"))