diff mbox series

[1/2] drm/i915/display: Initialize capability variables

Message ID 20240327044422.240398-3-suraj.kandpal@intel.com (mailing list archive)
State New, archived
Headers show
Series Fix UBSAN warning in hdcp_info | expand

Commit Message

Kandpal, Suraj March 27, 2024, 4:44 a.m. UTC
Initialize HDCP capability variables to false to avoid UBSAN
warning in boolean value.

--v2
-Fix Typo [Chaitanya]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Borah, Chaitanya Kumar March 28, 2024, 10:22 a.m. UTC | #1
Hello

> -----Original Message-----
> From: Kandpal, Suraj <suraj.kandpal@intel.com>
> Sent: Wednesday, March 27, 2024 10:14 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Borah, Chaitanya Kumar <chaitanya.kumar.borah@intel.com>; Kandpal,
> Suraj <suraj.kandpal@intel.com>
> Subject: [PATCH 1/2] drm/i915/display: Initialize capability variables
> 
> Initialize HDCP capability variables to false to avoid UBSAN warning in
> boolean value.
> 

Nit: I would add the fact that we need this change because the functions filling up these Booleans may return without actually assigning values to them.

Otherwise, LGTM.

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>


> --v2
> -Fix Typo [Chaitanya]
> 
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index b99c024b0934..95d14dab089e 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -191,7 +191,7 @@ static void intel_hdcp_info(struct seq_file *m,
>  			    struct intel_connector *intel_connector,
>  			    bool remote_req)
>  {
> -	bool hdcp_cap, hdcp2_cap;
> +	bool hdcp_cap = false, hdcp2_cap = false;
> 
>  	if (!intel_connector->hdcp.shim) {
>  		seq_puts(m, "No Connector Support");
> --
> 2.43.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index b99c024b0934..95d14dab089e 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -191,7 +191,7 @@  static void intel_hdcp_info(struct seq_file *m,
 			    struct intel_connector *intel_connector,
 			    bool remote_req)
 {
-	bool hdcp_cap, hdcp2_cap;
+	bool hdcp_cap = false, hdcp2_cap = false;
 
 	if (!intel_connector->hdcp.shim) {
 		seq_puts(m, "No Connector Support");