Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91556a47 authored by Kyong Hwa Bae's avatar Kyong Hwa Bae
Browse files

msm: camera: Fix a copy size for CSID configuration



Alloc the right amount size of csid vc configuration type,
and copy only that size.

Change-Id: I21dc1826a98c2f27cfb252dd78faef0e5b95320f
Signed-off-by: default avatarKyong Hwa Bae <kbae@codeaurora.org>
parent 597cda31
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -449,8 +449,7 @@ static long msm_csid_cmd(struct csid_device *csid_dev, void *arg)
			break;
		}
		for (i = 0; i < csid_params.lut_params.num_cid; i++) {
			vc_cfg = kzalloc(csid_params.lut_params.num_cid *
				sizeof(struct msm_camera_csid_vc_cfg),
			vc_cfg = kzalloc(sizeof(struct msm_camera_csid_vc_cfg),
			    GFP_KERNEL);
			if (!vc_cfg) {
				pr_err("%s: %d failed\n", __func__, __LINE__);
@@ -461,8 +460,7 @@ static long msm_csid_cmd(struct csid_device *csid_dev, void *arg)
			}
			if (copy_from_user(vc_cfg,
				(void *)csid_params.lut_params.vc_cfg[i],
				(csid_params.lut_params.num_cid *
				sizeof(struct msm_camera_csid_vc_cfg)))) {
				sizeof(struct msm_camera_csid_vc_cfg))) {
				pr_err("%s: %d failed\n", __func__, __LINE__);
				kfree(vc_cfg);
				for (i--; i >= 0; i--)