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

Commit f4259fd3 authored by Samantha Tran's avatar Samantha Tran
Browse files

drm/msm/dp: Add check for null pointer dereferencing



Add check for null returns from functions getting display
property, gpio_config, and wb_cfg.fmt.

CRs-Fixed: 2122564
Change-Id: I2b9124de554c472ca70bcf458be2e030e37adf4c
Signed-off-by: default avatarSamantha Tran <samtran@codeaurora.org>
parent 3fafba6f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -240,6 +240,9 @@ static int dp_parser_gpio(struct dp_parser *parser)

	mp->gpio_config = devm_kzalloc(dev,
		sizeof(struct dss_gpio) * ARRAY_SIZE(dp_gpios), GFP_KERNEL);
	if (!mp->gpio_config)
		return -ENOMEM;

	mp->num_gpio = ARRAY_SIZE(dp_gpios);

	for (i = 0; i < ARRAY_SIZE(dp_gpios); i++) {
+2 −0
Original line number Diff line number Diff line
@@ -3307,6 +3307,8 @@ int dsi_display_dev_probe(struct platform_device *pdev)
		return -ENOMEM;

	display->name = of_get_property(pdev->dev.of_node, "label", NULL);
	if (!display->name)
		display->name = "unknown";

	if (!boot_displays_parsed) {
		boot_displays[DSI_PRIMARY].boot_disp_en = false;
+6 −0
Original line number Diff line number Diff line
@@ -2572,6 +2572,12 @@ static int sde_hw_rotator_config(struct sde_rot_hw_resource *hw,
	wb_cfg.fps = entry->perf->config.frame_rate;
	wb_cfg.bw = entry->perf->bw;
	wb_cfg.fmt = sde_get_format_params(item->output.format);
	if (!wb_cfg.fmt) {
		SDEROT_ERR("null format\n");
		ret = -EINVAL;
		goto error;
	}

	wb_cfg.dst_rect = &item->dst_rect;
	wb_cfg.data = &entry->dst_buf;
	sde_mdp_get_plane_sizes(wb_cfg.fmt, item->output.width,