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

Commit 99508f0b authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: camera: Fix compile warnings



Fix the following compiler warning(s) from gcc 6.1.1 with -Werror enabled:

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3758:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3789:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3821:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3862:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %u",

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3894:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %u",

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3911:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",

 drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:3929:
   format '%u' expects argument of type 'unsigned int', but argument 6 has
	type 'long unsigned int' [-Werror=format=]
    CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",

Fixes: bf14c19b ("msm: camera: isp: Prevent out of bounds read")
Change-Id: Ic0dedbad59447f3a4c5ed03a525f9a7eb1fd6980
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 39dfdee9
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -3813,7 +3813,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,

		if (blob_size < (sizeof(uint32_t) * 2 + hfr_config->num_ports *
			sizeof(struct cam_isp_port_hfr_config))) {
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
				blob_size, sizeof(uint32_t) * 2 +
				sizeof(struct cam_isp_port_hfr_config) *
				hfr_config->num_ports);
@@ -3844,7 +3844,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,

		if (blob_size < (sizeof(uint32_t) * 2 + sizeof(uint64_t) *
			(clock_config->num_rdi + 2))) {
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
				blob_size,
				sizeof(uint32_t) * 2 + sizeof(uint64_t) *
				(clock_config->num_rdi + 2));
@@ -3876,7 +3876,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,

		if (blob_size < (sizeof(uint32_t) * 2 + (bw_config->num_rdi + 2)
			* sizeof(struct cam_isp_bw_vote))) {
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
				blob_size,
				sizeof(uint32_t) * 2 + (bw_config->num_rdi + 2)
				* sizeof(struct cam_isp_bw_vote));
@@ -3917,7 +3917,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,

		if (blob_size < (sizeof(uint32_t) * 2 + ubwc_config->num_ports *
			sizeof(struct cam_ubwc_plane_cfg_v1) * 2)) {
			CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %lu",
				blob_size,
				sizeof(uint32_t) * 2 + ubwc_config->num_ports *
				sizeof(struct cam_ubwc_plane_cfg_v1) * 2);
@@ -3949,7 +3949,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,

		if (blob_size < (sizeof(uint32_t) * 2 + ubwc_config->num_ports *
			sizeof(struct cam_ubwc_plane_cfg_v2) * 2)) {
			CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %lu",
				blob_size,
				sizeof(uint32_t) * 2 + ubwc_config->num_ports *
				sizeof(struct cam_ubwc_plane_cfg_v2) * 2);
@@ -3966,7 +3966,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,
		struct cam_isp_csid_clock_config    *clock_config;

		if (blob_size < sizeof(struct cam_isp_csid_clock_config)) {
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
				blob_size,
				sizeof(struct cam_isp_csid_clock_config));
			return -EINVAL;
@@ -3984,7 +3984,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,
		struct cam_fe_config *fe_config;

		if (blob_size < sizeof(struct cam_fe_config)) {
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
			CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu",
				blob_size, sizeof(struct cam_fe_config));
			return -EINVAL;
		}