Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3688563pxb; Mon, 24 Jan 2022 15:24:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSKL/8Amizey1pjblFFktwVAvGTnWHXAPuwB+gMXxnrDHwaL28uJo7219olbj6YifuCJqt X-Received: by 2002:a62:7bd4:0:b0:4c7:223b:ec4c with SMTP id w203-20020a627bd4000000b004c7223bec4cmr16023303pfc.56.1643066691114; Mon, 24 Jan 2022 15:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066691; cv=none; d=google.com; s=arc-20160816; b=NTmXRuas8w3L6FjtUpx/WcGyFc5qhf3csrVvMP6MohRnJSa3WqtqgYgz/qylDnwaw3 czV3JxDXCMADWuOvf/sqbHX/gvZvi9Nil4+lG50aPCSYbB22KEodsd3otym8oleeWYAr 1giEGpB8L2l0pR6TguDY5pbfcNyZ7g51cnjKCEGa4fOGSeLH/J65DxiGVh8zRLS9RY5n cAV/0Q78WLBdjmn4NMFZUz13R9Gqt16FpQ0o1zPcrBqGaeSgFOIGuzWNqBWeD3KbC8FY qlYY0wCLLOL34nfn69S7e3YbQ6nJFwYoxsBV/baz/biuPqfG1QOl+2KCRQIqVwubnINf 9vcA== 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=aZkF7XJ8JXYpZayuZ6WInNMQtQODcV4mvzJ6/spVYEI=; b=i9rAqV/NjXZ0AkHOTrBtQOdOWxQX7LRnO2o52ZdgR1Q3CZu2ntLFu/486qJde8vWgC nx3KcUXzI47y5yDxINc1QDCdx8K/LIHl/5GoDy8hgZ5WjJazAHO1igY/tKe+c/DQqSgG NrQFJh+B/AF+O9z+d6aS6JQnH8LOnakTUu1ZYsMmuj+gnY8YZ9npSzW7bqCdCzBRRwOV 1lrgvN2szQNtn1IcSKkHHpfTH6S0A8y5thugxXVyh4vy+vGlE63cfjk2kNOREbE+c9Y1 B1HMI9c7AHyE1bn3RSy7mzfqLXMUT+wX+TcIzHcyXSQBUemgkmkzPb6hEmKslmVY/0EC Uunw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZLPlQndk; 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 ls3si648331pjb.177.2022.01.24.15.24.38; Mon, 24 Jan 2022 15:24:51 -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=ZLPlQndk; 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 S1847882AbiAXXVA (ORCPT + 99 others); Mon, 24 Jan 2022 18:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1584613AbiAXWV3 (ORCPT ); Mon, 24 Jan 2022 17:21:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48364C0424E9; Mon, 24 Jan 2022 12:52:09 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D9D4060C11; Mon, 24 Jan 2022 20:52:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6450C340E5; Mon, 24 Jan 2022 20:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057528; bh=jVD31n0XfwWUjaU2jrHFkTVw1QFT1OP0Be3lL52UQb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZLPlQndkHezvCwgKLSuspS8hQHfvoYiXYNiCoL/Jr32YOFaWrIaw+61NT8s66+OUI clauQy61Yb9Boampqq6+Z8C/QQzJ4+9O2T8P2SWoj2hffkklxAMu0tSd8ZS50wfl72 JNuKnG3TXEQ+BHSaGznCHh+0RlC2fwDUGgavcDh0= 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.15 825/846] net: fix sock_timestamping_bind_phc() to release device Date: Mon, 24 Jan 2022 19:45:42 +0100 Message-Id: <20220124184129.359668763@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 @@ -830,6 +830,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;