video: tegra: camera: fix out-of-bounds read
Deepak Nibade [Mon, 18 Feb 2013 08:20:35 +0000 (13:20 +0530)]
fix Coverity issue
Coverity id : 22383

Bug 1046331

Change-Id: I8802e4d499b42f6c0ced28779cdebff819acf0f5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/201687
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
Tested-by: Jihoon Bang <jbang@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

drivers/video/tegra/camera/camera.c

index 67080a8..b1209c8 100644 (file)
@@ -278,7 +278,7 @@ struct tegra_camera *tegra_camera_register(struct platform_device *ndev)
        return camera;
 
 clk_get_fail:
-       for (; i > 0; i--)
+       while (i--)
                clk_put(camera->clock[clock_init[i].index].clk);
        misc_deregister(&camera->misc_dev);
 misc_register_fail: