From: Johan Hovold Date: Thu, 30 Mar 2017 10:15:40 +0000 (+0200) Subject: NFC: nfcmrvl_uart: fix device-node leak during probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d0607aa4aee88cb097b694caa619e68f1e0a39c6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git NFC: nfcmrvl_uart: fix device-node leak during probe Make sure to release the device-node reference when done parsing the node. Fixes: e097dc624f78 ("NFC: nfcmrvl: add UART driver") Cc: Vincent Cuissard Signed-off-by: Johan Hovold Signed-off-by: Samuel Ortiz --- 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; }