NFC: nfcmrvl_uart: fix device-node leak during probe
authorJohan Hovold <johan@kernel.org>
Thu, 30 Mar 2017 10:15:40 +0000 (12:15 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 18 Jun 2017 21:57:59 +0000 (23:57 +0200)
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>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/nfcmrvl/uart.c

index 6c0c301611c482407513429f99f42a9b7a57db72..91162f8e0366c87ab7d3e26f2f02344599fb100b 100644 (file)
@@ -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;
 }