Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3972040pxb; Tue, 25 Jan 2022 00:19:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7PxtTs0NtiABbdnt+fmxD/On+25JEK/ntsDX+jQJ28h9TJgugIDFRM8t0kNY9VrNdkTJU X-Received: by 2002:a17:906:7307:: with SMTP id di7mr15348272ejc.65.1643098775372; Tue, 25 Jan 2022 00:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098775; cv=none; d=google.com; s=arc-20160816; b=M1GEP06Ol5DMQ1ZGB5GaJRSX2kfKCSMd62qGIrKeYZo88BhM+g5UYMQKHjcVTZDFyO xFt2CLaLFd/sb5xu8QsE5AdHoJJyeQujcSrNXGbHM+gVoTVIOQ2mPszctvXqGnrVX+wC 2L3SxOh+Y4Apa2TK/Y4lKdizhUus1lAhN2D3+qhmT+s5vmcaxIMilQP32V/oLMpGrGOK r3RZa1N5p7Kq8x69xqBmTIuCtrPR216+mr+I05RSttPAEOIGBFAAE1x0likvgRWykFF2 coi968SV90g+eEiYROYctK/Kn13q+l52E7ttDeB0nXIXQj6WjNcbmN/BsFrA9bBMkvVK igdw== 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=WtIaRrFpRykAvhwBrSJDjBs9E5ncv/+xGfBx6MzxdN4=; b=UXIndS7aFZZywiRCui9vSmg381o8srPJTqN3obeRPNFuW7Lf97Fi92eQoZxxnuSJV5 pw2XkAzRCBw+E7DB84jHC9NuwRb/ou+BQ+LEt5/upj+sOAJSB3M304fs2VSYabSvvUS6 AvJE9HqJlP2JOvR6ghUALe4+3V6FyDfqHbVbD3MD+grvysneaPA/inVTRLW6n3J3B0mk HaJIA/5LZ1uYEv8+EPlPvqa/WUzS0Rc8sT96JfvtfB7J3yChtAhq9q6oL9/AqqHx2qm/ fRdvfm8XvGfP/GFEEdS0oC/eW/sjfaTIICDl7ecpn9cSDjmt0ybRxEzdSdylwvdosq3a vvkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="B24HB/VI"; 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 1si9232588ejm.158.2022.01.25.00.19.10; Tue, 25 Jan 2022 00:19:35 -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="B24HB/VI"; 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 S3413256AbiAYAin (ORCPT + 99 others); Mon, 24 Jan 2022 19:38:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2364587AbiAXXse (ORCPT ); Mon, 24 Jan 2022 18:48:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2982C07E32C; Mon, 24 Jan 2022 13:43:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 68BB8B812A5; Mon, 24 Jan 2022 21:43:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FD08C340E5; Mon, 24 Jan 2022 21:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060622; bh=T7Qh6ncURuM95zleYtc/I17OlL/HQAyS5maJpXJereo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B24HB/VInSjEUzu1V/eOMNp09xh0p0tJDMUVR8qNcy+p9LwDp7MUuU9HMvnWTzs7F dwDuoRoJ9w/iamWdeJKfQlvzyU/e3KcVh8gY8lfwcEioZqgz7ju6i56Q98WyhhkkVK eMgpPkQqIhFut9o0eRvTiUE+A7MXQi0UIzeTSZIM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miroslav Lichvar , Yangbo Lu , "David S. Miller" Subject: [PATCH 5.16 1008/1039] net: fix sock_timestamping_bind_phc() to release device Date: Mon, 24 Jan 2022 19:46:37 +0100 Message-Id: <20220124184159.173240015@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Miroslav Lichvar commit 2a4d75bfe41232608f5596a6d1369f92ccb20817 upstream. Don't forget to release the device in sock_timestamping_bind_phc() after it was used to get the vclock indices. Fixes: d463126e23f1 ("net: sock: extend SO_TIMESTAMPING for PHC binding") Signed-off-by: Miroslav Lichvar Cc: Yangbo Lu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/sock.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/core/sock.c +++ b/net/core/sock.c @@ -843,6 +843,8 @@ static int sock_timestamping_bind_phc(st } num = ethtool_get_phc_vclocks(dev, &vclock_index); + dev_put(dev); + for (i = 0; i < num; i++) { if (*(vclock_index + i) == phc_index) { match = true;