Skip to contentSkip to conversation

drm/komeda: Fix a signedness bug

PATCH In review Dan Carpenter 2 participants 2 messages Jan 21, 2019 – Jan 22, 2019

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

PATCH 1/1 drm/komeda: Fix a signedness bug

The mdev->irq value comes from platform_get_irq() so it can't be more than INT_MAX and if it's unsigned then it breaks the error handling in komeda_parse_dt().

Fixes 29e56aec911d ("drm/komeda: Add DT parsing")
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/display/komeda/komeda_dev.h +1 -1
index a0bf7050037a..a52da6180c69 100644
@@ -82,7 +82,7 @@ struct komeda_dev {
 	struct clk *mclk;
 
 	/** @irq: irq number */
-	u32 irq;
+	int irq;
 
 	int n_pipelines;
 	struct komeda_pipeline *pipelines[KOMEDA_MAX_PIPELINES];
Signature · 1 line
2.17.1
#1 lore raw
Quoted 15 lines · Dan Carpenter

The mdev->irq value comes from platform_get_irq() so it can't be more than INT_MAX and if it's unsigned then it breaks the error handling in komeda_parse_dt().

Fixes 29e56aec911d ("drm/komeda: Add DT parsing")
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/display/komeda/komeda_dev.h +0 -0
index a0bf7050037a..a52da6180c69 100644

drivers/gpu/drm/arm/display/komeda/komeda_dev.h struct komeda_dev { · line 86

Quoted 6 lines
drivers/gpu/drm/arm/display/komeda/komeda_dev.h +1 -1
@@ -82,7 +82,7 @@ struct komeda_dev {
 struct clk *mclk;
 
 /** @irq: irq number */
-u32 irq;
+int irq;
 

Hi Dan:

Thank you.

Liviu and I discussed this problem, and we decided to fix it by

Remove IRQ parsing from initial series:
https://patchwork.freedesktop.org/patch/277409/

And add it back when add the fully IRQ handling:
https://patchwork.freedesktop.org/patch/279491/

drivers/gpu/drm/arm/display/komeda/komeda_dev.h struct komeda_dev { · line 88

Quoted 2 lines
drivers/gpu/drm/arm/display/komeda/komeda_dev.h +0 -0
 int n_pipelines;
 struct komeda_pipeline *pipelines[KOMEDA_MAX_PIPELINES];

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.