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

Commit cae9b3fa authored by Li Sun's avatar Li Sun Committed by Stephen Boyd
Browse files

msm: camera: add error check in gc0339 config function



There will be some invalid ioctl arguments passed in from
userspace. Add error check to shield them.

Change-Id: Id24e4f6096a2d600215344e6f3601ef9544ee9b2
Signed-off-by: default avatarLi Sun <sunli@codeaurora.org>
parent c415b3c9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -490,6 +490,11 @@ int32_t gc0339_config(struct msm_sensor_ctrl_t *s_ctrl,
			break;
		}

		if (conf_array.addr_type == MSM_CAMERA_I2C_WORD_ADDR
			|| conf_array.data_type == MSM_CAMERA_I2C_WORD_DATA
			|| !conf_array.size)
			break;

		reg_setting = kzalloc(conf_array.size *
			(sizeof(struct msm_camera_i2c_reg_array)), GFP_KERNEL);
		if (!reg_setting) {