lkml.org 
[lkml]   [2019]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/bridge: sii902x: Variable status in sii902x_connector_detect() could be uninitialized if regmap_read() fails
Date
In function sii902x_connector_detect(), variable "status" could be
initialized if regmap_read() fails. However, "status" is used to
decide the return value, which is potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
---
drivers/gpu/drm/bridge/sii902x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 38f75ac580df..afce64f51ff2 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -246,7 +246,7 @@ static enum drm_connector_status
sii902x_connector_detect(struct drm_connector *connector, bool force)
{
struct sii902x *sii902x = connector_to_sii902x(connector);
- unsigned int status;
+ unsigned int status = 0;

mutex_lock(&sii902x->mutex);

--
2.17.1
\
 
 \ /
  Last update: 2019-09-30 06:45    [W:0.041 / U:2.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site