All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: vf610: disable clk on error handling path in probe
@ 2020-08-06  7:26 ` Evgeny Novikov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeny Novikov @ 2020-08-06  7:26 UTC (permalink / raw)
  To: Stefan Agner
  Cc: Evgeny Novikov, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Aditya Pakki, linux-mtd, linux-kernel,
	ldv-project

vf610_nfc_probe() does not invoke clk_disable_unprepare() on one error
handling path. The patch fixes that.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 6f0ce4dfc5a3 ("mtd: rawnand: vf610: Avoid a potential NULL pointer dereference")
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
---
 drivers/mtd/nand/raw/vf610_nfc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
index 7248c5901183..fcca45e2abe2 100644
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
@@ -852,8 +852,10 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 	}
 
 	of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev);
-	if (!of_id)
-		return -ENODEV;
+	if (!of_id) {
+		err = -ENODEV;
+		goto err_disable_clk;
+	}
 
 	nfc->variant = (enum vf610_nfc_variant)of_id->data;
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] mtd: rawnand: vf610: disable clk on error handling path in probe
@ 2020-08-06  7:26 ` Evgeny Novikov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeny Novikov @ 2020-08-06  7:26 UTC (permalink / raw)
  To: Stefan Agner
  Cc: ldv-project, Vignesh Raghavendra, Evgeny Novikov,
	Richard Weinberger, Miquel Raynal, linux-kernel, linux-mtd,
	Aditya Pakki

vf610_nfc_probe() does not invoke clk_disable_unprepare() on one error
handling path. The patch fixes that.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 6f0ce4dfc5a3 ("mtd: rawnand: vf610: Avoid a potential NULL pointer dereference")
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
---
 drivers/mtd/nand/raw/vf610_nfc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
index 7248c5901183..fcca45e2abe2 100644
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
@@ -852,8 +852,10 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 	}
 
 	of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev);
-	if (!of_id)
-		return -ENODEV;
+	if (!of_id) {
+		err = -ENODEV;
+		goto err_disable_clk;
+	}
 
 	nfc->variant = (enum vf610_nfc_variant)of_id->data;
 
-- 
2.26.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: rawnand: vf610: disable clk on error handling path in probe
  2020-08-06  7:26 ` Evgeny Novikov
@ 2020-09-07  7:21   ` Miquel Raynal
  -1 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2020-09-07  7:21 UTC (permalink / raw)
  To: Evgeny Novikov, Stefan Agner
  Cc: Miquel Raynal, ldv-project, Vignesh Raghavendra,
	Richard Weinberger, linux-kernel, linux-mtd, Aditya Pakki

On Thu, 2020-08-06 at 07:26:34 UTC, Evgeny Novikov wrote:
> vf610_nfc_probe() does not invoke clk_disable_unprepare() on one error
> handling path. The patch fixes that.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Fixes: 6f0ce4dfc5a3 ("mtd: rawnand: vf610: Avoid a potential NULL pointer dereference")
> Signed-off-by: Evgeny Novikov <novikov@ispras.ru>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: rawnand: vf610: disable clk on error handling path in probe
@ 2020-09-07  7:21   ` Miquel Raynal
  0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2020-09-07  7:21 UTC (permalink / raw)
  To: Evgeny Novikov, Stefan Agner
  Cc: ldv-project, Vignesh Raghavendra, Richard Weinberger,
	Aditya Pakki, linux-kernel, linux-mtd, Miquel Raynal

On Thu, 2020-08-06 at 07:26:34 UTC, Evgeny Novikov wrote:
> vf610_nfc_probe() does not invoke clk_disable_unprepare() on one error
> handling path. The patch fixes that.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Fixes: 6f0ce4dfc5a3 ("mtd: rawnand: vf610: Avoid a potential NULL pointer dereference")
> Signed-off-by: Evgeny Novikov <novikov@ispras.ru>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-07  7:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06  7:26 [PATCH] mtd: rawnand: vf610: disable clk on error handling path in probe Evgeny Novikov
2020-08-06  7:26 ` Evgeny Novikov
2020-09-07  7:21 ` Miquel Raynal
2020-09-07  7:21   ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.