Skip to contentSkip to conversation

drm/bridge: sii902x: fix a signedness bug in sii902x_audio_codec_init()

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 7, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 drm/bridge: sii902x: fix a signedness bug in sii902x_audio_codec_init()

The "num_lanes" variable needs to be signed for the error handling to work. The "i" variable can be a regular int as well.

Fixes ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")
---
 drivers/gpu/drm/bridge/sii902x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/sii902x.c +1 -1
index 6b03616d6bc3..dd7aa466b280 100644
@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
 		.max_i2s_channels = 0,
 	};
 	u8 lanes[4];
-	u32 num_lanes, i;
+	int num_lanes, i;
 
 	if (!of_property_read_bool(dev->of_node, "#sound-dai-cells")) {
 		dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Dan Carpenter

The "num_lanes" variable needs to be signed for the error handling to work. The "i" variable can be a regular int as well.

Fixes ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")

Colin send already fix for this.

Regards

Andrzej

Quoted 17 lines
---
 drivers/gpu/drm/bridge/sii902x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/sii902x.c +1 -1
index 6b03616d6bc3..dd7aa466b280 100644
@@ -719,7 +719,7 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
 		.max_i2s_channels = 0,
 	};
 	u8 lanes[4];
-	u32 num_lanes, i;
+	int num_lanes, i;
 
 	if (!of_property_read_bool(dev->of_node, "#sound-dai-cells")) {
 		dev_dbg(dev, "%s: No \"#sound-dai-cells\", no audio\n",