diff --git a/src/systemcmds/pwm/pwm.c b/src/systemcmds/pwm/pwm.c
index adfaff79c8aebf534d6bcf97aa1e014cf5bfb456..76f89b64ee9a2f181ed6aa27bdf4e07817921863 100644
--- a/src/systemcmds/pwm/pwm.c
+++ b/src/systemcmds/pwm/pwm.c
@@ -656,7 +656,7 @@ pwm_main(int argc, char *argv[])
 
 			if (ret > 0) {
 
-				read(0, &c, 1);
+				ret = read(0, &c, 1);
 
 				if (c == 0x03 || c == 0x63 || c == 'q') {
 					/* reset output to the last value */