Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2671993pxb; Mon, 11 Jan 2021 16:45:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRfnTVGutLZ/7UcxxvjCTTgDVDfZZmLPJn5hCd1t2Ie5dtejECHko1FJylCAC3a2WG5Dbb X-Received: by 2002:a05:6402:1714:: with SMTP id y20mr1382953edu.2.1610412318072; Mon, 11 Jan 2021 16:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610412318; cv=none; d=google.com; s=arc-20160816; b=vBecMhJlVG2bhIs8WsbVWLbMVahgrKFUL9jNwzF2U0Bdzq/MHOHCHDWqUYZy6GeRNJ Nxu+sHRDAMbuVEhjaLz+lgEqwGesXBsGEeatriF3P5l+/qhUtqQgSLSJ48smlyoPfihO BsW0WCCsjuWBwymCWHhVLyZzwV11vsFg4h+VXUwXlnBsPFFxFTXSdYQw2DhnZjK7xdcQ UVrgzmVScjZzUW3hAWLSqgHrFDz7APsOBx3nojuSrr8FqIBBX/iRjj1m1z3OoNSlp/9N /qneY4qTnkvOEkZrTGf5ZMlUFqpXiZ08P+QQOC72OckJpD9/8xB34Gfs9PRudr4ztl6A 5F+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CFEmQrdXEN0FRDXBKsS9x+Oj9qNY6pVWexVHVBWevAc=; b=QBINoaeRvKdEEDXdmPpnmHCc1Ygn5jFXYhBfBM2LFsZ3McRSNkqpXGg+kmt9COD3gT Bss05JVozITNUKUZxufn+2bVTO30W3eL7O67THXu92EEDno/PaZ/vmw/47wBEURw9qrZ xH5CqdFKUQxSSLFfMYALeGYUeOLccD8SjYO0q1ceNXLaVS3CZGeyA06dpsAUWOMdGdVm IqlcRHuk290xV+2rl1qZ+Q9kw3TnAkKrGzvolGexJq+kUiXruVYHYpHv/tx6891aBQ4H tip3k0eL6c2CzF58GfT8oufpJlFc7baQYVKLvXcI2nYwRKdaSqWXWCGbXuC2Iu+fKU2j JKXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BRt67GNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qq23si395731ejb.232.2021.01.11.16.44.53; Mon, 11 Jan 2021 16:45:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BRt67GNF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbhAKNBa (ORCPT + 99 others); Mon, 11 Jan 2021 08:01:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:48844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbhAKNB2 (ORCPT ); Mon, 11 Jan 2021 08:01:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC0F6225AC; Mon, 11 Jan 2021 13:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370025; bh=WAz2DXjUPQwMjWBf9kaZYpHszC5mGWvUu2NINlcPbqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRt67GNFtwoeB/Q5xTYX4lCJzEBcB9M4ow3uhGoP7tastD/VktkwqqErCJTxhDPBe QrG5do1qpZBsvcAEP3mTE470cdIIbNr1vuHrOcPJ27/xJhePu9VLkxFY2+Yx2N/WXF qkyeD7PSA0aMslILoBvGYD4CbBOrbY+cqppEbG4w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai Subject: [PATCH 4.4 18/38] usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() Date: Mon, 11 Jan 2021 14:00:50 +0100 Message-Id: <20210111130033.344874513@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130032.469630231@linuxfoundation.org> References: <20210111130032.469630231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai commit 83a43ff80a566de8718dfc6565545a0080ec1fb5 upstream. if of_find_device_by_node() succeed, usbmisc_get_init_data() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes: ef12da914ed6 ("usb: chipidea: imx: properly check for usbmisc") Signed-off-by: Yu Kuai Cc: stable Link: https://lore.kernel.org/r/20201117011430.642589-1-yukuai3@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/ci_hdrc_imx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -127,9 +127,13 @@ static struct imx_usbmisc_data *usbmisc_ misc_pdev = of_find_device_by_node(args.np); of_node_put(args.np); - if (!misc_pdev || !platform_get_drvdata(misc_pdev)) + if (!misc_pdev) return ERR_PTR(-EPROBE_DEFER); + if (!platform_get_drvdata(misc_pdev)) { + put_device(&misc_pdev->dev); + return ERR_PTR(-EPROBE_DEFER); + } data->dev = &misc_pdev->dev; if (of_find_property(np, "disable-over-current", NULL))