Add a default case to the switch case statement in mipi_exec_send_packet
to prevent attempts to read an uninitialized ret value.  It's unlikely
the default case will ever occur during regular exeuction, but if more
MIPI DSI Processor-to-Peripheral transaction types are ever added, then
having this in place will be a useful safety guard.

Signed-off-by: Jonathan Cavitt <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c 
b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
index 31edf57a296f..4b815ce6b1fe 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
@@ -171,6 +171,9 @@ static const u8 *mipi_exec_send_packet(struct intel_dsi 
*intel_dsi,
        case MIPI_DSI_DCS_LONG_WRITE:
                ret = mipi_dsi_dcs_write_buffer(dsi_device, data, len);
                break;
+       default:
+               ret = -EINVAL;
+               break;
        }
 
        if (ret < 0)
-- 
2.43.0

Reply via email to