diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index a1e9a980a44590dc0a0372649968e067dbdf7923..5ed2413eac8a1ebb817cf644f4a3008e7df1faf5 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1132,7 +1132,7 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,
 		mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
 		*mf = fmt->format;
 #else
-		return -ENOTTY;
+		ret = -ENOTTY;
 #endif
 	} else {
 		s64 val;