Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2673346pxb; Mon, 11 Jan 2021 16:48:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgszaYnX9I7uS8GoX9VYDJ2Pz6d09jqIoFI9pL2OzQnNZ3w8YoRPA2o1iD2vuLPknLz6TI X-Received: by 2002:a17:907:43f6:: with SMTP id mu6mr55620ejb.79.1610412488951; Mon, 11 Jan 2021 16:48:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610412488; cv=none; d=google.com; s=arc-20160816; b=pQQrrbJYZOzzYnz90jBz7RU+QvjA7Xq+jgyLb98TV5nezgAZuAZNyUZTtUY/gxhn1b +5BFiedeTC/+KQT7w1SChRw796+t7ZyMpYsrkDiERhd8ShA1+LrRjgoJmwpPHgw5pGSg SWMC4EDZsZRkgx2YUkjx5X4/mr2wUG3pAn1UyHTGCXpvpEVTsPf1Rzv39UQtjv/DXx92 6qOwKW/RCYoDrjJbICwpLj+1oozzysSsNMDa0SRakmRvnAYF0wTLItXZF7TXjWeDbNJ4 2rUzls+WoSt5J0yDb/RkmpL7IzDB5oxYvd2egxiJiSoUegf186vXxZtE9UdcojAMkZUQ i21Q== 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=1YZBPg89qtMPrYhpsw5891qtT46poXG8JZa6FPjP1b0=; b=B0cl9id/iGvpabnnrcbv1oGz3d2RwHH36TyzWQwHBPiqnvHwtKEHdYKMqkqU5jykY2 c+pGLZu+IIP+9R3ZFFiuHI3m+06K0ZreF4IOXDrt7+QPBrUUaY6N/EcNhj+D/Q2UYw1t PFyNJWiUQfiyNMxV/PhIiOyLWTO4K5RonqYEZqWaeZ9V9poVd3JzbcpH65uv3TOtEasg DwItOTAkNtFRfmdYvaVYLg4YCAk1K0LHL4AUjOc20VmO6Ka+uaObZ3qVb/A+hOe+YDEG Wxc1+8JSN53pCCb2jt+Ks6+Norn9avaIh+oYi6s2E6IwXSN6VOSefEdV4LTTR1rodL+a zuWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wjW4vKqy; 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 jp23si257498ejb.696.2021.01.11.16.47.45; Mon, 11 Jan 2021 16:48:08 -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=wjW4vKqy; 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 S1730152AbhAKNEN (ORCPT + 99 others); Mon, 11 Jan 2021 08:04:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:50204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbhAKNDp (ORCPT ); Mon, 11 Jan 2021 08:03:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2982C22515; Mon, 11 Jan 2021 13:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370205; bh=DGjqeSzhmZONKmlP3RH4AQsxitnDkiXln9C4V30Kcok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wjW4vKqy29or1SEoJsUt6z7RKrLsA0u61z3+6Wcu+kNEms676vXq78CBhgN54Atel vnaxVG8NlH5TqqgwiPgaiPnEFnCRfHmJTJBsokZUNXz+M5Ka149pP1CNtXfXWrOdrG lMMiRum3xybUbueJ1S/sRJowehF6lt4PGibajnr0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai Subject: [PATCH 4.9 24/45] usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() Date: Mon, 11 Jan 2021 14:01:02 +0100 Message-Id: <20210111130034.822910169@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130033.676306636@linuxfoundation.org> References: <20210111130033.676306636@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 @@ -133,9 +133,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))