소스 검색

iio: adc: twl6030-gpadc: fix error return code in twl6030_gpadc_read_raw()

Fix to return -EINTR in the error handling case instead
of 0 (ret is assigned after goto, which has no effect),
as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Wei Yongjun 12 년 전
부모
커밋
2d2da9fc71
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/iio/adc/twl6030-gpadc.c

+ 1 - 1
drivers/iio/adc/twl6030-gpadc.c

@@ -537,8 +537,8 @@ static int twl6030_gpadc_read_raw(struct iio_dev *indio_dev,
 		ret = -ETIMEDOUT;
 		goto err;
 	} else if (timeout < 0) {
-		goto err;
 		ret = -EINTR;
+		goto err;
 	}
 
 	switch (mask) {