MLK-20192-1: max9286: Coverity: fix potential uninitialized scalar variable
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Thu, 20 Dec 2018 02:23:16 +0000 (10:23 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
The variable maybe unassigned but used by function ,so fix potential
uninitialized scalar variable

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
drivers/media/platform/imx8/max9286.c

index 1b71c65..bef5826 100644 (file)
@@ -133,7 +133,7 @@ enum ov10635_mode {
 };
 
 enum ov10635_frame_rate {
-       OV10635_15_FPS,
+       OV10635_15_FPS = 0x1,
        OV10635_30_FPS,
 };
 
@@ -2817,8 +2817,10 @@ static int max9286_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
 
                if (tgt_fps == 30)
                        frame_rate = OV10635_30_FPS;
-               if (tgt_fps == 15)
+               else if (tgt_fps == 15)
                        frame_rate = OV10635_15_FPS;
+               else
+                       frame_rate = 0;
 
                if (frame_rate != OV10635_30_FPS && frame_rate != OV10635_15_FPS) {
                        pr_err(" The camera %d frame rate is not supported!\n", frame_rate);