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

Commit e57d78a6 authored by Venkata Rao Kakani's avatar Venkata Rao Kakani Committed by Gerrit - the friendly Code Review server
Browse files

driver/ethernet/camera: NULL pointer checks before accessing



Check NULL pointer conditions before accessing the
structure to avoid crashes.

Change-Id: I7633d94c265f01793f7aafc3ec2b27379539b857
Signed-off-by: default avatarVenkata Rao Kakani <vkakani@codeaurora.org>
parent cedd6dde
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -3968,7 +3968,7 @@ void msm_isp_process_axi_irq_stream(struct vfe_device *vfe_dev,
	struct msm_isp_buffer *done_buf = NULL;
	unsigned long flags;
	struct timeval *time_stamp;
	struct timeval *time_stamp_system;
	struct timeval *time_stamp_system = NULL;
	uint32_t frame_id, buf_index = -1;
	struct msm_vfe_axi_stream *temp_stream;

@@ -4124,10 +4124,11 @@ void msm_isp_process_axi_irq_stream(struct vfe_device *vfe_dev,
			stream_info, done_buf, time_stamp, frame_id);
		return;
	}

	if (time_stamp_system != NULL) {
		msm_isp_process_done_buf(vfe_dev, stream_info,
		done_buf, time_stamp, time_stamp_system, frame_id);
	}
}

void msm_isp_process_axi_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0, uint32_t irq_status1,
+9 −10
Original line number Diff line number Diff line
@@ -2181,21 +2181,20 @@ static int atl1c_tx_map(struct atl1c_adapter *adapter,
		use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma);
		use_tpd->buffer_len  = cpu_to_le16(buffer_info->length);
	}

	if (use_tpd && buffer_info) {
		/*The last tpd*/
		use_tpd->word1 |= 1 << TPD_EOP_SHIFT;
		/*The last buffer info contain the skb address,
	   so it will be free after unmap */
		*so it will be free after unmap
		*/
		buffer_info->skb = skb;

		return 0;

	}
err_dma:
	buffer_info->dma = 0;
	buffer_info->length = 0;
	return -1;
}

static void atl1c_tx_queue(struct atl1c_adapter *adapter, struct sk_buff *skb,
			   struct atl1c_tpd_desc *tpd, enum atl1c_trans_queue type)
{