[bug report] drm/bridge: imx: add driver for HDMI TX Parallel Video Interface
Dan Carpenter
dan.carpenter at linaro.org
Wed Feb 7 09:51:00 UTC 2024
Hello Lucas Stach,
This is a semi-automatic email about new static checker warnings.
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c:81 imx8mp_hdmi_pvi_bridge_enable()
warn: variable dereferenced before check 'bridge_state' (see line 54)
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c
53 {
54 struct drm_atomic_state *state = bridge_state->base.state;
^^^^^^^^^^^^^^
bridge_state is dereferenced here.
55 struct imx8mp_hdmi_pvi *pvi = to_imx8mp_hdmi_pvi(bridge);
56 struct drm_connector_state *conn_state;
57 const struct drm_display_mode *mode;
58 struct drm_crtc_state *crtc_state;
59 struct drm_connector *connector;
60 u32 bus_flags, val;
61
62 connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
63 conn_state = drm_atomic_get_new_connector_state(state, connector);
64 crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
65
66 if (WARN_ON(pm_runtime_resume_and_get(pvi->dev)))
67 return;
68
69 mode = &crtc_state->adjusted_mode;
70
71 val = FIELD_PREP(PVI_CTRL_MODE_MASK, PVI_CTRL_MODE_LCDIF) | PVI_CTRL_EN;
72
73 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
74 val |= PVI_CTRL_OP_VSYNC_POL | PVI_CTRL_INP_VSYNC_POL;
75
76 if (mode->flags & DRM_MODE_FLAG_PHSYNC)
77 val |= PVI_CTRL_OP_HSYNC_POL | PVI_CTRL_INP_HSYNC_POL;
78
79 if (pvi->next_bridge->timings)
80 bus_flags = pvi->next_bridge->timings->input_bus_flags;
81 else if (bridge_state)
^^^^^^^^^^^^
This check for NULL is too late. Hopefully it can it be removed?
82 bus_flags = bridge_state->input_bus_cfg.flags;
83
regards,
dan carpenter
More information about the dri-devel
mailing list