Skip to contentSkip to conversation

vlynq: Fix uninitialized error code in probe()

PATCH In review Dan Carpenter 3 participants 3 messages Mar 28, 2019 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vlynq: Fix uninitialized error code in probe()

The "result" variable isn't initialized on this error path.

Fixes 55e331cf7ebe ("drivers: add support for the TI VLYNQ bus")
---
 drivers/vlynq/vlynq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vlynq/vlynq.c +2 -1
index c0227f9418eb..44d3485d1108 100644
@@ -727,7 +727,8 @@ static int vlynq_probe(struct platform_device *pdev)
 	dev->local_irq = dev->irq_end - dev->irq_start;
 	dev->remote_irq = dev->local_irq - 1;
 
-	if (device_register(&dev->dev))
+	result = device_register(&dev->dev);
+	if (result)
 		goto fail_register;
 	platform_set_drvdata(pdev, dev);
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

The "result" variable isn't initialized on this error path.

Fixes 55e331cf7ebe ("drivers: add support for the TI VLYNQ bus")

-Mukesh

Quoted 18 lines
---
  drivers/vlynq/vlynq.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vlynq/vlynq.c +2 -1
index c0227f9418eb..44d3485d1108 100644
@@ -727,7 +727,8 @@ static int vlynq_probe(struct platform_device *pdev)
  	dev->local_irq = dev->irq_end - dev->irq_start;
  	dev->remote_irq = dev->local_irq - 1;
 
-	if (device_register(&dev->dev))
+	result = device_register(&dev->dev);
+	if (result)
  		goto fail_register;
  	platform_set_drvdata(pdev, dev);
 
Acked-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

The "result" variable isn't initialized on this error path.

Fixes 55e331cf7ebe ("drivers: add support for the TI VLYNQ bus")

Andrew can you pick this up the same you have you done that before?

Quoted 19 lines
---
 drivers/vlynq/vlynq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vlynq/vlynq.c +2 -1
index c0227f9418eb..44d3485d1108 100644
@@ -727,7 +727,8 @@ static int vlynq_probe(struct platform_device *pdev)
 	dev->local_irq = dev->irq_end - dev->irq_start;
 	dev->remote_irq = dev->local_irq - 1;
 
-	if (device_register(&dev->dev))
+	result = device_register(&dev->dev);
+	if (result)
 		goto fail_register;
 	platform_set_drvdata(pdev, dev);
 
Signature · 1 line
Florian