Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2273730pxb; Mon, 11 Jan 2021 05:46:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcvdDrbIjZDBOP8NZLs6iUOJIC/BbaWjmKoTEA9xEaaC+E9J9cvQAt2/GiC5GTVLOHel6X X-Received: by 2002:a17:906:d930:: with SMTP id rn16mr11022196ejb.412.1610372792236; Mon, 11 Jan 2021 05:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610372792; cv=none; d=google.com; s=arc-20160816; b=atcV0rxrpFAlFaJ2QwTJXApX3ot3CRTeBaDmOiMfC5ZKx+eF1FaicdMyZOJDSn+HP7 to8L62K/Ylb7NE9fRHR1d7vTsjUAkQw8TD1hSyaInKr4U0ETFxwlwkAYVigy4LQBHuRH JqGnsO2i3D4BWYlbYLJY2GsQunyK141Tge/eH2uVzk16gOd0JIUcpDDrRzqx/7s/p3Yo FfEj39WOebobhYidJgkAaAgvvpnk/XS00K6/a18HMqGa81p9wKI15aUhpCpZwGXkeSE6 Dt6RsDb+vpFlDTeRvzC4xfmGtRVPgjrK4iMy/j/QK6E/PusDVpL56ip7ZyMG5Mk7XZNx ynHw== 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=WAX9FmKmbMzqn9hYQmx4O6ExfYexsmlMGO/Hgb9IrZ4=; b=wQUNW203TaquddtHd8RRt1UtRm/d6bNlf38efnPC01mnaCo7XoE+/GM4Ur24NY0anj KxVgku+05e3DnM22o7hhIy7lNTJF7PwxUy8icUQgXu4dYDFTw0XTFHFhkCjaquRx0cwT 45phLmnKQdVePYz5ekhaRUoDT/RqOswV5HI5ACogDecGxFuzAwsLwZsnjnWt6/C6fEmD 7zy336CHI+fTAs6MpCZUhpNIXNWufwEaTYPVJhNoo7UCjdFKkMeMpdiEQiWxBfF6QKLg W7qUk/51xXRLpRkrg2qYC4Ku5qbKsH+Ohqpi3Hp0ndCw6boVlCQYDHY+cGU8RKTKGXk7 tRLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SftU3BfJ; 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 zc8si6466652ejb.662.2021.01.11.05.46.07; Mon, 11 Jan 2021 05:46:32 -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=SftU3BfJ; 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 S1731493AbhAKNnq (ORCPT + 99 others); Mon, 11 Jan 2021 08:43:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:58500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730737AbhAKNLw (ORCPT ); Mon, 11 Jan 2021 08:11:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA9182250F; Mon, 11 Jan 2021 13:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370697; bh=BWYcWP3aNUwnjZWiVR99nwIp3Z0D++CFG5rwRWS12WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SftU3BfJNGdyWeiGnotVR5lTsmyemLnCCBlAe85PiGWX4bpb6vUflsNaOLuuc3Sby kronOvx4Cak9qEVF6UT9gREigjSL1CaokHupbh5K5C9IrnsselJHpHDylnJxxohoAZ JWrQvE5snBn94/6LKQ+XyBhFy3LFZS1xLyORZJBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai Subject: [PATCH 5.4 57/92] usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() Date: Mon, 11 Jan 2021 14:02:01 +0100 Message-Id: <20210111130041.893546666@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@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 @@ -139,9 +139,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; /*