diff mbox series

i2c: sh7760: fix IRQ error path

Message ID 5b81bf63-edc4-bb62-3aff-4ae9432e339b@omprussia.ru
State New
Headers show
Series i2c: sh7760: fix IRQ error path | expand

Commit Message

Sergey Shtylyov April 17, 2021, 7:05 p.m. UTC
While adding the invalid IRQ check after calling platform_get_irq(),
I managed to overlook that the driver has a complex error path in its
probe() method, thus a simple *return* couldn't be used.  Use a proper
*goto* instead!

Fixes: e5b2e3e74201 ("i2c: sh7760: add IRQ check")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

---
This patch is against the '2c/for-next' branch of Wolfram's 'linux.git' repo.
I wasn't even able to complie-test it though...

 drivers/i2c/busses/i2c-sh7760.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang April 17, 2021, 8:01 p.m. UTC | #1
On Sat, Apr 17, 2021 at 10:05:05PM +0300, Sergey Shtylyov wrote:
> While adding the invalid IRQ check after calling platform_get_irq(),
> I managed to overlook that the driver has a complex error path in its
> probe() method, thus a simple *return* couldn't be used.  Use a proper
> *goto* instead!
> 
> Fixes: e5b2e3e74201 ("i2c: sh7760: add IRQ check")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
> 

Applied to for-next, thanks!
diff mbox series

Patch

Index: linux/drivers/i2c/busses/i2c-sh7760.c
===================================================================
--- linux.orig/drivers/i2c/busses/i2c-sh7760.c
+++ linux/drivers/i2c/busses/i2c-sh7760.c
@@ -473,7 +473,7 @@  static int sh7760_i2c_probe(struct platf
 
 	ret = platform_get_irq(pdev, 0);
 	if (ret < 0)
-		return ret;
+		goto out3;
 	id->irq = ret;
 
 	id->adap.nr = pdev->id;