Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1612867 > unrolled thread

[PATCH v2 6/8] NFC: nfcmrvl_uart: fix device-node leak during probe

Started byJohan Hovold <johan@kernel.org>
First post2017-03-30 12:20 +0200
Last post2017-03-30 12:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 6/8] NFC: nfcmrvl_uart: fix device-node leak during probe Johan Hovold <johan@kernel.org> - 2017-03-30 12:20 +0200

#1612867 — [PATCH v2 6/8] NFC: nfcmrvl_uart: fix device-node leak during probe

FromJohan Hovold <johan@kernel.org>
Date2017-03-30 12:20 +0200
Subject[PATCH v2 6/8] NFC: nfcmrvl_uart: fix device-node leak during probe
Message-ID<tqFlo-4ME-19@gated-at.bofh.it>
Make sure to release the device-node reference when done parsing the
node.

Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver")
Cc: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/nfc/nfcmrvl/uart.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nfc/nfcmrvl/uart.c b/drivers/nfc/nfcmrvl/uart.c
index 6c0c301611c4..91162f8e0366 100644
--- a/drivers/nfc/nfcmrvl/uart.c
+++ b/drivers/nfc/nfcmrvl/uart.c
@@ -84,6 +84,7 @@ static int nfcmrvl_uart_parse_dt(struct device_node *node,
 	ret = nfcmrvl_parse_dt(matched_node, pdata);
 	if (ret < 0) {
 		pr_err("Failed to get generic entries\n");
+		of_node_put(matched_node);
 		return ret;
 	}
 
@@ -97,6 +98,8 @@ static int nfcmrvl_uart_parse_dt(struct device_node *node,
 	else
 		pdata->break_control = 0;
 
+	of_node_put(matched_node);
+
 	return 0;
 }
 
-- 
2.12.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web